MrEd Posted October 15, 2007 Share Posted October 15, 2007 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 More sharing options...
weaponx Posted October 15, 2007 Share Posted October 15, 2007 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 More sharing options...
MrEd Posted October 15, 2007 Author Share Posted October 15, 2007 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 More sharing options...
Uten Posted October 15, 2007 Share Posted October 15, 2007 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.. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
MrEd Posted October 15, 2007 Author Share Posted October 15, 2007 XP Pro, Domain functional level 2003. Link to comment Share on other sites More sharing options...
Nathan89 Posted October 15, 2007 Share Posted October 15, 2007 (edited) 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) ExitWith 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,Nathanedit: The above info is assuming you use Active Directory. Edited October 15, 2007 by Nathan89 Link to comment Share on other sites More sharing options...
MrEd Posted October 29, 2007 Author Share Posted October 29, 2007 Thanks, I found your reply when I came to post how I finally got it to work. I was using mapped drives not UNC's perhaps that was my problem. Ed 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