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.