Jump to content

Running scripts from a network drive


Guest
 Share

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...