Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

BREAKTHROUGH! Accepting user input in batch files

Featured Replies

  • 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 Schaeffer

http://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: " variablename

Will 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


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: "

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..

  • Author

@Zoster,

Thanks, but the SET /P doesn't work in DOS - that's what I was shooting for.

@RayOK

Yes, 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

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%pause

Now, when I run this, I get this output:

Enter a new administrator name: SomeAdminECHO is off.Press any key to continue

as 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

  • 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

  • 5 months later...

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.