Services, local security policies, registry

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
broksainis
Posts: 5
Joined: 17 Nov 2013 13:46

Services, local security policies, registry

#1 Post by broksainis » 24 May 2014 15:51

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?

broksainis
Posts: 5
Joined: 17 Nov 2013 13:46

Re: Services, local security policies, registry

#2 Post by broksainis » 25 May 2014 14:51

Any chances to edit/change security settings?

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: Services, local security policies, registry

#3 Post by penpen » 25 May 2014 16:16

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

Dragokas
Posts: 43
Joined: 30 Jul 2013 09:42
Location: Ukraine, USSR
Contact:

Re: Services, local security policies, registry

#4 Post by Dragokas » 26 May 2014 08:17

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.

broksainis
Posts: 5
Joined: 17 Nov 2013 13:46

Re: Services, local security policies, registry

#5 Post by broksainis » 27 May 2014 06:30

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;

Post Reply