How to run a batch file on a local network as Administrator? (Vista)

batch-filenetworkingwindows-vista

I have a couple of batch files which must be run as Administrator. I can do so if they are on my machine, but when I put them on the network and then try to run them as Administrator, the command prompt simply shows no output and finishes, apparently without executing any of the code. When I run the network batch files normally, I at least get a bunch of error messages telling me that access is denied.

Any ideas how to fix this behavior?

I am executing these batch files via shortcut, and the shortcuts do not use UNC paths. I have also configured the shortcut to run as Administrator.

Best Answer

Network drive mappings exist per-user session, so when your shortcut runs within the security context of administrator, no drive mappings exist.

Try calling the batch script in your shortcut via UNC, rather than referencing a drive letter.