Sign in to follow this  
Followers 0
pvr02

Running scripts from a network drive

2 posts in this topic

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' )
   Exit
EndIf

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  
Followers 0