micheldk Posted October 22, 2006 Share Posted October 22, 2006 Hello! I have the following problem under Window XP SP1: I want to use the RunAsSet command to execute a task as an administrator. I could not get it to work in the test I have done. I first give the RunAsSet("user", "domain", "password", 0) command, giving the proper user, domain and passord data. Tt gives a 1 return code. Then I execute a RunWait command: RunWait("Notepad", @WorkingDir, @SWMAXIMIZE) and get an error message "Directory name is invalid" Using the Windows Runas command works with the exact same domain, user, password (I used one admin user, and a simple user , both work). Yet I want to use the AutoIt command to do this, as windows RUNAS cannot redirect the input of the password. ANy clue of what I am doing wrong? What I found in the forum is that there seems to be a bug in SP2, however, I am running SP1. Thanks in advance to anyone who could give me a hand on this one! Micheldk Link to comment Share on other sites More sharing options...
Valik Posted October 22, 2006 Share Posted October 22, 2006 I would virtually guarantee that the account you are trying to run as does not have rights to access @WorkingDirectory. Always specify the working directory parameter to Run() to a directory you know the target user can access. Typically people run their scripts from the Desktop and in most cases, the Desktop directory of one user is not accessible by other users. Link to comment Share on other sites More sharing options...
micheldk Posted October 22, 2006 Author Share Posted October 22, 2006 Dear Valik, Bingo, this was spot-on! Thanks a lot for the super-fast answer. Really appreciated! Michel 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