au3scr Posted January 1, 2008 Share Posted January 1, 2008 How i make script that add's new user? In cmd: net user NewAccountName /add net user NewAccountName * <new password> <ReEnter password> But how to do same thing with autoit? Link to comment Share on other sites More sharing options...
JustinReno Posted January 1, 2008 Share Posted January 1, 2008 Look in the helpfile. There is a very clear command. Link to comment Share on other sites More sharing options...
au3scr Posted January 1, 2008 Author Share Posted January 1, 2008 I couldnt find it, sorry Can you say me what word in help file should i search? Link to comment Share on other sites More sharing options...
Bert Posted January 1, 2008 Share Posted January 1, 2008 Look in the helpfile. There is a very clear command.Well, I looked for it, and I couldn't find it either. I used in my search "account", and "user" with no hits. I also scrolled through all the commands and did not se what you are referring to. @au3scr: you could use _runDOS to do it. The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
DW1 Posted January 1, 2008 Share Posted January 1, 2008 Something like this?Adduser("normaluser");normal user Adduser("adminuser", 1);Admin user Func Adduser($username, $admin = 0) RunWait(@ComSpec & " /c " & 'Net user ' & $username & " /add", "", @SW_HIDE) If $admin = 1 Then RunWait(@ComSpec & " /c " & 'Net Localgroup Administrators ' & $username & " /add", "", @SW_HIDE) EndFunc ;==>Adduser AutoIt3 Online Help Link to comment Share on other sites More sharing options...
crzftx Posted January 1, 2008 Share Posted January 1, 2008 How about create a batch file with your code in it. (Just open a new notepad and save as "newUser.bat") From AutoIt, Use RunWait("newUser.bat") Link to comment Share on other sites More sharing options...
DW1 Posted January 1, 2008 Share Posted January 1, 2008 I already gave him this and it works as expected. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
crzftx Posted January 1, 2008 Share Posted January 1, 2008 I already gave him this and it works as expected.ok... so that means no more help is allowed?that's a very effective strategy, except for the diminishing intellectual expansion that will be seen as a result. Link to comment Share on other sites More sharing options...
DW1 Posted January 1, 2008 Share Posted January 1, 2008 How about create a batch file with your code in it.(Just open a new notepad and save as "newUser.bat")From AutoIt, Use RunWait("newUser.bat")That was your help...I am just pointing out what is more efficient, has already been posted.I am definitely not saying no more help is wanted. But lets move in the right direction.No need to take this personally, like it appears you were. This isn't an attack on you, or anything you posted. Settle down.I am merely pointing out the fact that calling an external batch file isn't an autoit solution.... this IS the autoit forum though. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
crzftx Posted January 1, 2008 Share Posted January 1, 2008 But lets move in the right direction.Okay, in the right direction, simply creating a new user would be fastest without waiting for the RunWait to finishusing Run would be more efficient.to Run one external file would be quicker than running two.(@comspec is the macro that defines cmd.exe, you are just running cmd twice, while i run it once) Link to comment Share on other sites More sharing options...
DW1 Posted January 1, 2008 Share Posted January 1, 2008 If you would read the script more closely, you would notice why there is a run wait. It must wait until the user acount is created (less than a second) before it is able to make the account admin. The second cmd only runs if you need the user to be admin... why are you arguing with me? How long did it take your RunWait to finish?... if it took a notable amount of time, you should look into your system issues. You could probably make the runwait an option that just runs (like you said, without the wait) if the admin parameter is not selected. But if the admin parameter is selected you will NEED the runwait. The If $admin = 1 runwait could just be changed to a run, but I left it as runwait, just in case somebody tries to create multiple accounts in a loop. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
au3scr Posted January 1, 2008 Author Share Posted January 1, 2008 Thanks alot, script works 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