Run elevated privilege command from batch file or command prompt running without elevated privilege
Hi all, I have to write a batch file for Windows 7 which runs some commands that needs administrator privilege. This batch file is actually started by another process which does not have elevated privilege, i can't do right click and say "run as administrator" to this process as its not a executable, it is a library and i have no option to specify this process to run as administrator in my code. So what i want to know is, How can i run elevated privilege commands from my batch script which is running without elevated privilege. I tried with "runas" command with /user option but it does not work. Just wondering will "runas" command help me? If yes how? Also i read we can disable UAC but i can't even do that in my batch script as the script does not have the privilege. Note: I am logged in to the machine with administrator privileges. Thanks in advance.
August 28th, 2010 10:59pm

Since disabling UAC would require a reboot, the batch based change would not be helpful for only temporary disabling UAC. What happens, if you run the batch as Scheduled Task with appropriate permissions? You could start this with schtasks.exe. Best greetings from Germany Olaf
Free Windows Admin Tool Kit Click here and download it now
August 29th, 2010 12:28am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics