April 25, 200422 yr Author OK, after a bit more searching, I've come across exactly what we're looking for in a 1K freeware DOS utility - INPUT.COM by Horst Schaefferhttp://home.mnet-online.de/horst.muc/You'll find INPUT.COM in the PBAT sction on the left. The syntax is painfully simple:INPUT "Enter phrase here: " variablenameWill prompt the user to enter any alphanumeric string (words, spaces, etc.) and will save it in variablename after pressing enter. Sheesh, and I thought I was coming up with something new. Folks, this will solve your input problems. But at least Adam got some good code out of it. Ignore my CHOICE code, I am going to use INPUT from now on.Sigh,JP
April 26, 200422 yr Hmm why don't you use the /p switch of the set command?set /P disksize="Please enter the desired size of C: in MB: "
April 26, 200422 yr getvar does the exact same thing as input.com.. haven't compared the two so maybe input.com may be a little smaller and user friendly.I'm pretty sure set /p only works in Windows 2000 and XP with cmd.exe, not in a older, pure DOS environment, with command.com..
April 26, 200422 yr Author @Zoster,Thanks, but the SET /P doesn't work in DOS - that's what I was shooting for.@RayOKYes, I think GETVAR is even made by the same guy (I saw it on his website as well), but it's alot larger than INPUT. I'm putting INPUT on a boot floppy with lots of other tools, so size matters.I wonder what the WinME version of COMMAND.com would buy us, in terms of additional features. Anyone know?JP
April 26, 200422 yr Personally I would scrap MSDOS and use FreeDOS. Free and much more powerful.FreeDOS
April 28, 200422 yr I have a problem with the INPUT.COM program.Here's my current test batch file:@echo offUtilities\INPUT "Enter a new administrator name: " newadminecho %newadmin%pauseNow, when I run this, I get this output:Enter a new administrator name: SomeAdminECHO is off.Press any key to continueas you can see, it's not actually setting the variable. Even if I set the variable beforehand, it just retains it's old value. Can anyone help me with this?Edit: Never mind.. just say this: Note: INPUT does not work under Win NT/2000/XP
May 1, 200422 yr Author Folks,You will notice that I've rewritten my original post to include the INPUT.COM user input utility and simplified my script quite a bit.JP
Create an account or sign in to comment