Jump to content

Scripts will not run from network shares


MrEd
 Share

Recommended Posts

I am attempting to use a compiled script which uses the RunAsSet to install software from network shares.

I have tried

RunAsSet('localAdministrator',@Computername,'PASSWORD')

RunAsSet('domainAdministrator','domain','PASSWORD')

Both return the error

Line-1:

Error: Unable to execute the external program.

The system can not find the path specified.

All files are in the same directory as the script and if the directory is copied to the local desktop it works perfectly.

I would rather not have to copy the directory to a couple thousand desktops if possible :-)

Man, I wish I would have known about this app years ago.

Thanks for any assistance,

Ed

Link to comment
Share on other sites

I think you might need the flag on RunAsSet() to load the profile if you want it to automatically map the network drives.

RunAsSet ( ["user", "domain", "password" [, options]] )

options [optional] 0 = do not load the user profile, 1 = (default) load the user profile, 2 = use for net credentials only

Otherwise you will have to use DriveMapAdd()

Link to comment
Share on other sites

Well, I have tried just about everything. BTW testApp.exe is notepad.exe renamed.

I tried adding ,0 ,1 ,2 after "password" One at a time of course It failed each time

I set up a msgbox() call after each fileChangeDir command and echoed the @workingDir it reflected the current path had been changed

If I comment out the RunAsSet line, authenticate as adminUser it throws a Windows 'testApp.exe has encountered a problem and needs...' error

If I manually change drive and directories the application works as expected.

The Secondary Logon service is started

;network share
RunAsSet("adminUser","domain","password")
if DriveMapGet("O:") = "" Then
    DriveMapAdd("O:","\\server1\apps")
Else
    $oldPath = DriveMapGet("O:")
    DriveMapDel("O:")
    DriveMapAdd("O:","\\server1\apps")
    $oldWorkingDir = @WorkingDir
    FileChangeDir("O:\testApp")
    Run("testApp.exe")
    FileChangeDir($oldWorkingDir)
    DriveMapDel("O:")
    DriveMapAdd("O:",$oldPath)
EndIf
Link to comment
Share on other sites

Just a hunch, but witch OS is trying to run your code?

If I recall right Vista does not allow executables to be running off a share unless you do some registry changes. Don't recall where and what to change so I guess there is an google exercise down the road. Unless some off the more seasoned administrators care to comment..:)

Link to comment
Share on other sites

XP Pro, Domain functional level 2003.

This is what I use:

$DomainUserName = "administrator"

$DomainName = "domain"

$UserPassword = "password"

RunAsSet($DomainUserName, $DomainName, $UserPassword)

Run("\\server\folder\instal.exe", "", @SW_SHOWDEFAULT)

Exit

With added notes:

$DomainUserName = "administrator" These first three lines are self explanatory just your user name, domain, and password.

$DomainName = "domain"

$UserPassword = "password"

RunAsSet($DomainUserName, $DomainName, $UserPassword)

Run("\\server\folder\instal.exe", "", @SW_SHOWDEFAULT) Make sure you have the exact address to the installer.

Exit

Hope this helps,

Nathan

edit: The above info is assuming you use Active Directory.

Edited by Nathan89
Link to comment
Share on other sites

  • 2 weeks later...

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...