Jump to content

Recommended Posts

Posted

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?

Posted

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")

Posted

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.

Posted

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.

Posted

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 finish

using 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)

Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...