Jump to content
Sign in to follow this  

Running scripts from a network drive

Recommended Posts


I have noticed that most of the scripts I try to run work just fine on my local PC however fail when run from a mapped network drive. I need to make a registry change on users machines who don't have access to modify the registry. All the script does it restart itself as admin and writes the registry key.

I receive the message:

Line 0 (File "S:\dnscache.exe"):

Run("" & @SCRIPTFULLPATH & '" parameter' )

Error: Unable to execute the external program.

The system cannot find the path specified

$DomainUserName = "domainusername"
$DomainName = "domainname"
$UserPassword = "password"
If $CmdLine[0] = 0 then
   RunAsSet($DomainUserName, $DomainName, $UserPassword)
   Run('"' & @SCRIPTFULLPATH & '" parameter' )

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache", "Start", "REG_DWORD", "2")

If it is run off of a local drive, it works with no problems. Any ideas?

Share this post

Link to post
Share on other sites

I think you should declare the path where the file is located on the environmental variables on the PATH. I have a similar problem with IPCONFIG, I just declare it there and worked.

Hope this also work for you.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.