General discussion

Locked

DOS Bat with %1 - How to detect this as Error in Bat file?

By ken.roberts ·
I have a simple DOS batch file, "copyin.bat" that has one variable, which is referenced by %1. The variable is the user's own directory on our server. So if John wants to copy in my files to his directory, he just enters: "copyin John".

However, sometimes the user will forget and just run the batch file without the variable, typing in "copyin" all by itself. How can I use the ErrorLevel variable or some other method to detect this and then issue this:

Echo You forgot to enter your Name - please rerun the program

Any ideas?

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Desktop Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums