RediXe Posted February 18, 2008 Share Posted February 18, 2008 (edited) RunAsSet("login", "gs", "Pass") Run("S:\kidpix4\setup.exe /s") S drive is mapped when some one logs on. I am getting "The system cannot find the path specified". I tried taking the S out and just using the path but that didn't work either. I'm at a loss here. This is really my first autoit script and I got everything working except getting it to run as admin. Edited February 18, 2008 by RediXe Link to comment Share on other sites More sharing options...
Swift Posted February 18, 2008 Share Posted February 18, 2008 Go to Setup.exe and right click: Properties...Look at Location: What EXACTLY Does It? Does It Say: "S:\kidpix4\" ? Link to comment Share on other sites More sharing options...
RediXe Posted February 18, 2008 Author Share Posted February 18, 2008 Go to Setup.exe and right click: Properties...Look at Location: What EXACTLY Does It? Does It Say: "S:\kidpix4\" ?It's different I just shortened it for posting. It works without the RunAsSet. The original path is this but figured the "S:\kidpix4\" would be easier to work with for troubleshooting this problem.Run("S:\Tech-Fixes\Packages\kidpix4\setup.exe /s") Link to comment Share on other sites More sharing options...
Danny35d Posted February 18, 2008 Share Posted February 18, 2008 "The system cannot find the path specified".This happen a lot with the Run and RunWait functions. Look at the help file and add the working dir. Run ( "filename" [, "workingdir" [, flag[, standard_i/o_flag]]] ) AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
Danny35d Posted February 18, 2008 Share Posted February 18, 2008 "The system cannot find the path specified".This happen a lot with the Run and RunWait functions. Look at the help file and add the working dir. Run ( "filename" [, "workingdir" [, flag[, standard_i/o_flag]]] ) AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
LarryDalooza Posted February 18, 2008 Share Posted February 18, 2008 The user whose context you are using needs to have access to this S: drive. If you logged in as the "gs" user, would you be able to Run() that path? Remember when you change user by using RunAsSet(), the current user's access no longer matters. Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
RediXe Posted February 18, 2008 Author Share Posted February 18, 2008 (edited) The user whose context you are using needs to have access to this S: drive. If you logged in as the "gs" user, would you be able to Run() that path? Remember when you change user by using RunAsSet(), the current user's access no longer matters. Lar. Batch File to run:if exist "C:\Program Files\The Learning Company\Kid Pix Deluxe 4\KP.exe" goto :END net use /delete s: net use S: \\orion\wh Call "S:\Tech-Fixes\Packages\kidpix4\tests.exe" :END tests.au3 RunAsSet("administrator", "gs", "******", 0) Run("setup.exe", "\\orion\wh\Tech-Fixes\Packages\kidpix4\") ;Sleep("10000") ;Send ("{ENTER}") ;Sleep ("2000") ;Send ("{UP}") ;Sleep("2000") ;Send ("{ENTER}") ;Sleep("2000") ;Send("{ENTER}") ;Sleep ("2000") ;Send("{ENTER}") WinWaitActive ("Register") Sleep ("2000") Send("{ESC}") Sleep("2000") WinWaitActive ("Install Halted") Sleep ("2000") WinClose("Install Halted") Sleep("2000") WinWaitActive ("Acrobat Reader 5.1 Setup") Sleep ("2000") WinClose("Acrobat Reader 5.1 Setup") Sleep("2000") WinWaitActive ("Exit Setup") Sleep ("2000") Send("y") ;WinWaitActive ("Kid Pix Deluxe 4 - InstallShield Wizard", "InstallShield Wizard Complete") ;Send ("{ENTER}") RunAsSet() Exit I still having the same problems. EDIT: I see why this isn't going to work. Not sure how to delete the S: drive and remap it with autoIt after I use the RunAsSet Edit 2: RunAsSet("administrator", "gs", "7csz7n2k", 0) DriveMapDel( "S:" ) DriveMapAdd( "S:", "\\orion\wh" ) Run("setup.exe /s", "S:\Tech-Fixes\Packages\kidpix4\") Did not fix the issue. Yes I took the net use out of the batch file. Edited February 18, 2008 by RediXe Link to comment Share on other sites More sharing options...
LarryDalooza Posted February 18, 2008 Share Posted February 18, 2008 try...RunAsSet("Administrator","gs","****") RunWait("cmd") when the CMD prompt opens try doing the "Net Use" stuff in the RunAsSet users context... what is left is to test different RunAsSet() options ... parameter 4... Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
LarryDalooza Posted February 18, 2008 Share Posted February 18, 2008 I usually use it like this... RunAsSet("administrator", "gs", "******", 2) Run("\\orion\wh\Tech-Fixes\Packages\kidpix4\setup.exe","\\orion\wh\Tech-Fixes\Packages\kidpix4") I think... but it has been quite some time since I have needed to do this type of thing... again... experiment with an open CMD to see what is possible. Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
RediXe Posted February 18, 2008 Author Share Posted February 18, 2008 try...RunAsSet("Administrator","gs","****") RunWait("cmd") when the CMD prompt opens try doing the "Net Use" stuff in the RunAsSet users context... what is left is to test different RunAsSet() options ... parameter 4... Lar. "The directory name is invalid." I tried options 0,1,2 and nothing is working. Wasn't sure if you saw both the EDITS I did before you got your post off. Link to comment Share on other sites More sharing options...
LarryDalooza Posted February 18, 2008 Share Posted February 18, 2008 Who is this user you are trying to use? Are you able to use this user to log into the PC? For some reason it seems this user does not have access to network resources when logged in... I don't know... this seems specific to your domain or local setup. Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
RediXe Posted February 18, 2008 Author Share Posted February 18, 2008 (edited) I usually use it like this... RunAsSet("administrator", "gs", "******", 2) Run("\\orion\wh\Tech-Fixes\Packages\kidpix4\setup.exe","\\orion\wh\Tech-Fixes\Packages\kidpix4") I think... but it has been quite some time since I have needed to do this type of thing... again... experiment with an open CMD to see what is possible. Lar. Changing the Run command to this fixed the issue. THANK YOU so much. Now just have to fix the end of the autoit script so it doesn't cancel the program install. Edited February 18, 2008 by RediXe 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