Guest Posted September 6, 2007 Share Posted September 6, 2007 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? Link to comment Share on other sites More sharing options...
DavidA Posted September 6, 2007 Share Posted September 6, 2007 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now