how can i login as admin within a batch file. I also want to do. I tried runas command. but it is prompting password. I want to run one batch file from normal user login but i want it to run with administrative privilage. and also i dont want user to know about the password also.

This doesn’t work for me (Vista Pro x64). I did as instructed, tried with cmd /c as well. All I have in my (test) BAT file is ‘pause’ so I’d expect it to pause but it doesn’t. It does when ran as a non-admin but doesn’t neither when right-clicked and Ran as Administrator nor with the shortcut trick.

Hey Im running windows 7 trying to get this to work on my computer with a batch file. Only even when I make a shortcut the always run as admin box is greyed out and cant be selected how does one go about correcting this?

In Windows 7, there is no need to run a batch file to restart the spooler service. Open up ‘Device and Printers’, right click on your default print device and select ‘Troubleshoot’. If it finds a problem with the Spooler service, it will restart it.