kokomodrums Posted March 22, 2013 Share Posted March 22, 2013 Pretty simple issue. v3.3.8.1I set up a script to run a few of our office programs as an admin. All of the locally installed programs (on the C drive) worked flawlessly, however running the exact script but on a program on our network (S drive) gives me an error. Here is the script:Local $sUserName = "admin" Local $sPassword = "***" RunAs($sUserName, @ComputerName, $sPassword, 1, "S:\test.bat", @SystemDir) If @error = 1 Then MsgBox(4096, "Error", "Something went wrong, but I'm not sure why...") EndIfI've tried every option for the logon flag and the working directory. Does the RunAs function just not work on network shares? Link to comment Share on other sites More sharing options...
Developers Jos Posted March 22, 2013 Developers Share Posted March 22, 2013 Does this Local PC Admin account have access to this network drive? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
kokomodrums Posted March 22, 2013 Author Share Posted March 22, 2013 (edited) Yes, full access I tried looking up a way to get an actual error message, but it was a bit above my head. Is there a simple way to display an actual description of what goes wrong from autoit? Edited March 22, 2013 by kokomodrums Link to comment Share on other sites More sharing options...
Developers Jos Posted March 22, 2013 Developers Share Posted March 22, 2013 (edited) Then try using the UNC link to the networkshare because it is unlikely that drive S: is known under the elevated credentials. Jos Edited March 22, 2013 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
kokomodrums Posted March 22, 2013 Author Share Posted March 22, 2013 (edited) [edit] Well, I had already tried the unc path to no avail, but I just tried it again and for some reason it's working now. I must have mis-typed the path. I'm still not sure why it wouldn't work using the mapped drive, as I didnt have that problem using autohotkey to do the same task. Thanks! Edited March 22, 2013 by kokomodrums 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