Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Is there any way to input a text value from a batch file prompt? Like "What would you like to name this file?" or "What comment do you want to add to this registry backup?" Thanks.

Yes, there is.
You would have to use an input method to ask user for the input, save it to a variable then use that variable. Here follows an example. Let's say the backup file is "backup.dat" and that the comment mark is "::". e.g.::: THIS IS A COMMENT
===== Script Start (omit this line) =====
@echo off
echo BATCH_INPUT___hgQX-PPP_XPPP E#HH0E50EG0Ef0Ehs>$$input.com
echo $$input.bat hoAX5@@PZYh@xX5@D3!r/P[WX,b,-PZh>>$$input.com
echo X3!X2ErP,{,{PYX4=0ErWX,j,-PZh@@X3!=set input>>$$input.com
echo What comment do you want to add to this registry backup?
$$input.com
call $$input.bat
echo :: %input%>> backup.dat
for %%d in (bat com) do if exist $$input.%%d del $$input.%%d
set input====== Script end (omit this line) =====
Watch out for line wrapping. All lines that don't begin with two spaces could wrap.
That input method has not check for errors (input may not contain any of these characters: | = ). That's some thing I leave to you to do.
-- Secret_Doom - Leonardo Pignataro --
secret_doom@hotmail.com
www.batch.hpg.com.br

Sorry, the following information didn't print out ok at my reply:
THE INPUT MAY NOT CONTAIN ANY OF THE FOLLOWING CHARACTERS:
< > | =-- Secret_Doom - Leonardo Pignataro --
secret_doom@hotmail.com
www.batch.hpg.com.br

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |