Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

User input in DOS batch file - Renaming a text file

Posted on 2004-08-17
9
Medium Priority
?
3,128 Views
Last Modified: 2008-02-01
I am trying to rename a text file inside of a batch file before copying it to a network directory. I am running Caldera DOS. The program is a service program that is called via a single batch file. I can copy output.txt to the network directoy, but would really like to prompt the user for the unit sn and rename output.txt to unitsn.txt before copying it to the network directory.

Any help would be appreciated!

Erik
0
Comment
Question by:ratbert1001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 10

Expert Comment

by:For-Soft
ID: 11827972
It is possible to create file and save user input to it, and run it to assign input as variable:
ECHO SET INPUT=>input.bat
TYPE CON>>input.bat
CALL input.bat

User have to use [CTRL] [Z] and then [ENTER] to accept entered data.
Variable %INPUT% will be filled with word entered by user.
0
 
LVL 14

Expert Comment

by:JohnK813
ID: 11831636
You could also try

set /p input=Enter a file name:
move output.txt %input%.txt

For-Soft, please correct me in set /p doesn't work in Caldera DOS
0
 
LVL 10

Expert Comment

by:For-Soft
ID: 11833265
set /p is Microsoft Windows NT/2000 specific. I don't know if it works in Caldera DOS.
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 14

Expert Comment

by:JohnK813
ID: 11833972
Well, it looks like I learned something new today, then.  Thanks.
0
 

Author Comment

by:ratbert1001
ID: 11873796
Neither of these is exactly what I am looking for. Are there any old freeware programs out there that will allow me to do somthing like this?
0
 
LVL 8

Accepted Solution

by:
K_2K earned 800 total points
ID: 11877969
INPUT     String input/editing          ver 1.2 (c) 2001 Horst Schaeffer

http://home.mnet-online.de/horst.muc
0
 
LVL 1

Assisted Solution

by:shanekelly_7
shanekelly_7 earned 800 total points
ID: 11923653
set /p var=Prompt:
set var=%var:~%
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question