Jump to content
Sign in to follow this  


Recommended Posts


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!


Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...