Home > Server 2008, Windows 7, Windows Desktop Operating System, Windows Server, Windows Vista, Windows XP > Problems Running Batch Files in Windows Server 2008

Problems Running Batch Files in Windows Server 2008

November 24th, 2009 Aaron Leave a comment Go to comments

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.

TwitterFacebookEvernoteDiggStumbleUponInstapaperShare
  1. Eli
    November 25th, 2009 at 06:30 | #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.

  2. November 25th, 2009 at 08:38 | #2

    Does that do the same thing as right-clicking on the file and choosing “Run as Administrator”?

  3. eli
    November 25th, 2009 at 15:30 | #3

    @Aaron
    yeah it just set the properties on that file to always try to run as the administrator.

  1. November 25th, 2009 at 00:22 | #1
  2. November 25th, 2009 at 00:26 | #2