Floutsch Posted November 14, 2007 Share Posted November 14, 2007 Hi there, I'm trying to create a user with Run which just won't work. I've been looking at it for hours and I don't get it... the code is as follows: CODE$call = "net user " & $localaccount_user & " " & $localaccount_pass & " /add /active:yes /fullname:Support@Home /passwordreq:yes"; MsgBox(0, "Test", $call) Run(@ComSpec & " /c " & $call, "", @SW_HIDE) if @error Then MsgBox(17, "Error", "Support@Home user couldn't be created...") Exit EndIf $localaccount_user and $localaccount_pass come from a GUI-window and therefor from the user. The MsgBox shows the correct call but it just won't create the user. Dropping the content of $call to the command line creates the user without any problems. I've tried RunWait, I've tried to Run only $call (without @ComSpec and so on) and even ShellExecute (didn't expect it to work, but hey...). Uh, what else to tell you that might be important...? I've set 'AutoItSetOption("RunErrorsFatal", 0)'. And the first MsgBox in my example is obviously for debugging purposes, but it shows what I expect to work... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 14, 2007 Moderators Share Posted November 14, 2007 Did you try RunAsSet? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Floutsch Posted November 14, 2007 Author Share Posted November 14, 2007 No, I didn't. Would that be of any sense considering that the same user who calls the AutoIt script should also be the one executing the command? This very same user can take the command and get the new user created when trying it at the command line. Besides: There's also #RequireAdmin in the script - forgot to write that 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