Discussion Locked

Batch file script, how to prompt for use

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

When writing batch file scripts, how do I prompt a user so I can have them enter a password and username?
I am making a script that lets me add a computer to a domain, and I need to be able to have it prompt for admin name and password.
thanks!!

4 replies

by syscokid

Back in the old days, where it called for admin name in the script we would put %1, and for password we'd put %2.

Then when running the batch file we'd type "filename adminname password" and filename would run, passing the parameters adminname and password to %1 and %2 respectively.

That's not exactly what you are looking for but it will work.

Hope this helps!

by Former member

Use NETDOM from the resource-kit:
"NETDOM ADD /Domain:"
If you're not logged in as domain admin, add "/UserD: /PasswordD:"

This discussion is closed to new replies.