Discussion Locked

Batch files in DOS

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I would like write a batch file in DOS for Windows XP and 2000 that prompts the user to put their first name in, hit enter, and then it creates the directory structure accordingly. For example, I want dos to say please enter your full first name, I type Jason and press enter, dos creates the structure c:\jason. Is this possible with batch files? Everything I have looked at only allows for one character choices such as one number. I need to be able to have a variable with several characters. Please help.

7 replies

by xirix

Hi,

Have you thought in using WSH files (Windows Scripting Host) to do that???

The syntax is simple and looks like ASP.
It will be more user-friendly, because you will be using the Windows GUI instead the black screen of DOS.

You will have more power than with the batch file (imagine inserting the user info into a database).

Hope it helps.
X|r|X

by cactus pete

set /p firstname=

It will sit there and wait for you to enter 'whatever' and hit return... I know it works in 2k, but I'm not sure about xp.

The rules for how it's used and what you allow to be there are up to you... error handling, such as misspellings and pre-existing directories...

by jasonbis

Thanks for the info. I like answer number two. That is the answer and command I have been looking for. I would prefer not to get into scripting if I don't have to. The set command worked great. Thanks to both of you though.

This discussion is closed to new replies.