Search code examples
windowsbatch-filecommandadministratornetwork-drive

Run a batch file with administrator account from a network drive


The script given in the answer to this question works perfectly when running from a local drive accessible to both the normal user and the administrator.

However, when run from a network drive (which is a very real possibility in University environments) it runs into file not found issues.

Does anybody have an idea how to fix this?


Solution

  • Went for the simplest workaround: The batch file now copies all files it requires to the user's temp folder (which is local & accessible to admins) before running the "as admin" part.

    Bit of a hassle, large & ugly batch file, but it works