Solved

User input in DOS batch file - Renaming a text file

Posted on 2004-08-17
9
3,098 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
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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 200 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 200 total points
ID: 11923653
set /p var=Prompt:
set var=%var:~%
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now