When running a batch file in Server 2008 by double-clicking on it, any commands that are executed use limited permissions due to the built-in User Account Control (UAC) which is enabled by default.  Also, Server 2008 won’t ask you if you want to run with admin rights when you run the batch file, or if it comes across any commands which might need elevated privileges.  Those commands will quietly fail.  Isn’t that helpful?

You could spend hours troubleshooting your commands thinking they are faulty when it is just as simple as a privilege issue on the batch file that you ran.

Bottom line, if you are testing a batch file, right-click on it and choose “Run as Administrator”.  This will give the batch file full rights.

5 Replies to “Problems Running Batch Files in Windows Server 2008”

  1. FTR, if UAC is on, you can right click on any bat or exe and select the compatibility tab. In that screen, you can choose the option to “run this program as an administrator”. If you turn of UAC, the option should be grayed out.

Leave a Reply

Your email address will not be published. Required fields are marked *