Computing.Net > Forums > Programming > Text Input Box in a Batch File

Text Input Box in a Batch File

Reply to Message Icon

Original Message
Name: R475
Date: January 22, 2007 at 13:22:22 Pacific
Subject: Text Input Box in a Batch File
OS: Win2K
CPU/Ram: .
Model/Manufacturer: .
Comment:

In my batch file (see code below) the Xname variable is set by a command line parameter.

How would I go about prompting the user with a text input box and have the Xname variable set by the text given in the input box?

<code>

@Echo Off

Set Folder="\rename"
Set Xname=%2
For %%A in (%Folder%\xx1cxt00xx*.txt) Do Call :REN %%A

GoTo :EOF

:REN
Set File=%~nx1

Ren %Folder%\%File% %Xname%%File:~10%
GoTo :EOF


</code>



Report Offensive Message For Removal


Response Number 1
Name: IVO
Date: January 22, 2007 at 13:34:21 Pacific
Subject: Text Input Box in a Batch File
Reply: (edit)

No input boxes in batch scripts as they are command line code. To prompt for an input string code

Set /P Xname=Enter New Filename^>

And by the way what is the %1 parameter?


Report Offensive Follow Up For Removal

Response Number 2
Name: R475
Date: January 22, 2007 at 14:09:35 Pacific
Subject: Text Input Box in a Batch File
Reply: (edit)

The %1 parameter is left over from previous code, I'm trying to figure out right now how to take it out of my code and still have the code work.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Text Input Box in a Batch File

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge