Jump to content

RESOLVED -- adding a carriage return in a bat script


dslider

Recommended Posts

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! /add

REM # need to add a Y or a carriage return in here

Edited by dslider
Link to comment
Share on other sites


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?

Link to comment
Share on other sites

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.

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

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