dslider Posted April 16, 2008 Posted April 16, 2008 (edited) OK heres my issue. I am writing a script that automatically creates a user account and sets a password. The problem I am having is when I run the bat file it requires user input because I am using a 16 char password. It either needs to have a carriage return or a Y. I have tried all I can think of to pass the Y and the carriage return but I cant seem to get it to work. Can someone help me out?Here is whats in the bat file:REM ##############################################REM # Create account REM ##############################################net user TestUser IhateThisStuff0! /addREM # need to add a Y or a carriage return in here Edited April 17, 2008 by dslider
Idontwantspam Posted April 16, 2008 Posted April 16, 2008 echo Y | net user TestUser IhateThisStuff0! /addThat should work. However... usually you don't need to hit Y for a net user command, imo...
dslider Posted April 17, 2008 Author Posted April 17, 2008 I have already tried that and it does not work..... the reason it needs a response is because its over the 14 char limit for OS below 2000..... try it and you will see.. It looks like it works but says no valid response was provided...any other suggestions? Is there a way to enter a carriage return without having to add an additional file?
Scr1ptW1zard Posted April 17, 2008 Posted April 17, 2008 Try this:net user TestUser IhateThisStuff0! /add /y
engjcowi Posted April 17, 2008 Posted April 17, 2008 Have you tried autoit? Its free and can send any key you wish. Its very simple and even has a fantastic help system. It comes with a file is help identify the handle of whatever input is needed then you simply tell it to "send enter or tab" or whatever key yuo want it to and it will.
dslider Posted April 17, 2008 Author Posted April 17, 2008 Try this:net user TestUser IhateThisStuff0! /add /yThank You.... this worked..... I thought I had tried this but I guess not.....
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now