I have a script to create various services on our dev servers (all Windows 2008 64bit), using sc.exe.
The script includes setting the user account to run the service as, but I can never get the password set correctly. It sets the account name up fine, but whenever I attempt to start the service I get a logon failure. If I manually change the password in the service snap in, it works fine... what gives??
I've tried with and without quotes around the password, no success.
Example of the command I use: sc create PackageProcessing5 binPath= "c:\Program Files (x86)....exe" obj= na\sys-WSPackager password= "password"
Like I said, the service creates successfully, and when I check the snap-in, the user account is correct too. Just the password somehow gets overlooked. I've noticed that if I put an incorrect password in the command line it doesn't complain so I guess it's not validating it at all during creation?
Any ideas here?