• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 484
  • Last Modified:

Restarting a computer using a batch file and log into a user account

This is a continuation of a previous question.

I've setup Windows Task Scheduler to run a small batch file that restarts a computer that needs to be restarted on a regular/automatic schedule.

shutdown /r

Works beautifully as a .BAT file.

What can i add to this code to actually logon as a specified user after the machine restarts:

DomainName\GenericUserName


As always, Thanks in advance EE!
jpertchik
0
jpertchik
Asked:
jpertchik
2 Solutions
 
oleggoldCommented:
You have to configure group policy for this to use in windows ,dos doesn't have a logon ,if You use Novell ,this is implemented by their policy too
0
 
HomerTNachoCheeseCommented:
Look over this website.

You could add the registry settings to a script that runs with your batch.

http://www.petri.co.il/configuring_autologon.htm

You could have a startup script that also clears the registry settings if you want.
0
 
jpertchikAuthor Commented:
HomerTNachoCheese,

I went to the site you mentioned. This is Win 7 and the keys look somewhat different. See attached screen cap, Please advise what to change.

Thanks,
jpertchik
ForHomerTNachoCheese.JPG
0
 
QlemoDeveloperCommented:
The keys are exactly the same for Vista and W7.

If you prefer a more secure way (because the password is not stored in the reg key shown), download AutoLogon from www.sysinternals.com (http://technet.microsoft.com/en-us/sysinternals/bb963905), and either set it up manually using the GUI, or via commandline:
  autologon user domain password
It needs to run on the PC it should change AutoLogon, but I reckon this is not an issue here.
0
 
jpertchikAuthor Commented:
These were partial answers that were given. I decided to go with the answer to a previous question. It was so similar in nature minus the automatic log in. It is not needed at this point.
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now