Batch file for changing log on account THANKS

November 29, 2011 at 18:21:56
Specs: Windows x86
i'm trying to write a script to stop a group of services , change the Log on name / set password for each service and then start then back up. For this examples I used the BITS Service in windows .....
What I have so far are as follows:

I'm not sure about much of this and any help would grateul!

sc query state= all | grep "SERVICE_NAME: BITS" > C:\sc.out

-----------------Start Services Change Script-------------------

sc config <BITS> obj= TeeCee etc.
sc stop . . .
sc start . . .

C:\>sc stop

sc <server> stop [BITS]

C:\>sc start

sc <server> start [BITS] <arg1> <arg2> ...

C:\>sc config

sc <server> config [BITS]
DisplayName= <TESTUSER>
password= <password>...

NOTE: The option name includes the equal sign.
type= <own|share|interact|kernel|filesys|rec|adapt>
start= <boot|system|auto|demand|disabled>
error= <normal|severe|critical|ignore>
binPath= <BinaryPathName>
group= <LoadOrderGroup>
tag= <yes|no>
depend= <Dependencies(separated by / (forward slash))>
obj= <AccountName|ObjectName>
DisplayName= <display name>
password= <password>


See More: Batch file for changing log on account THANKS

Report •

November 29, 2011 at 21:07:29
anyone? thanks!

Report •

November 30, 2011 at 07:40:58
Thanks for any help, i really need it

Report •

December 1, 2011 at 15:00:00
sc has funky syntax - namely in requiring a space after the = sign, using your BITS example it would look like this:

@echo off
:: Stop Service
sc stop BITS

:: Change Logon Name
sc config "BITS" obj= domain\user password= YourPassword

:: Start Service
sc start BITS

Report •

Related Solutions

Ask Question