Page 1 of 1

Services, local security policies, registry

Posted: 24 May 2014 15:51
by broksainis
Finally done my batch file 1st part - services editing.

Code: Select all

@ECHO OFF
cls
:sakums
echo =======My batch=======
echo ====================================



:selector
set input=
ECHO 1. Turn off services..
ECHO 2. Local Security Policy..
ECHO 3. Registry..
echo ====================================
set /p input=Choose:
if %input%==1 goto 1
if %input%==2 goto 2
if %input%==3 goto 3

@REM Invalid Choice Message
@echo Invalid choice.
goto selector


:1
cls
echo ====================================
:selector2

set input=
ECHO 4. Plug Play
ECHO 5. Indexing Service
ECHO 6. Windows Time
ECHO 7. Default (Windows Xp default)
echo ====================================

set /p input=Which service?t:
if %input%==4 goto 4
if %input%==5 goto 5
if %input%==6 goto 6
if %input%==7 goto 7

@REM Invalid Choice Message
@echo Invalid choice.
goto selector2

:4
sc config "PlugPlay" start= disabled
pause
goto end

:5
sc config "CiSvc" start= disabled
pause
goto end

:6
sc config "W32Time" start= disabled
pause
goto end

:7
cls
sc config "PlugPlay" start= auto

sc config "CiSvc" start= demand

sc config "W32Time" start= auto


echo Services turned off.

pause
goto end



pause
goto end



pause
goto end


:2
echo ...
pause
goto end

:3
echo ...
pause
goto end

:end


Is it possible to edit, for example, 3 local security settings?
How about registry?

Re: Services, local security policies, registry

Posted: 25 May 2014 14:51
by broksainis
Any chances to edit/change security settings?

Re: Services, local security policies, registry

Posted: 25 May 2014 16:16
by penpen
I don't know how to do that in batch, but maybe these settings could be changed using registry settings.
To find out what registry settings could be involved (if any), you may use Process Monitor:
http://technet.microsoft.com/en-us/us-en/sysinternals/bb896645.aspx.

penpen

Re: Services, local security policies, registry

Posted: 26 May 2014 08:17
by Dragokas
Hi, broksainis !

You can easily find the changes in registry using RegShot Tool - http://sourceforge.net/projects/regshot/
But to apply changes when you direct write the registry values, you need to reboot OS.
Some changes can be applied with commands:

Code: Select all

rundll32 user32.dll,UpdatePerUserSystemParameters
gpupdate /force


Best wishes, Alex.

Re: Services, local security policies, registry

Posted: 27 May 2014 06:30
by broksainis
Ok. Thanks.
Can you tell me, what I need to write, if I want :
to change password minimal length;
to change guest account name;
to change max. password age;