Sign in with
Sign up | Sign in
Your question

MSDOS Batch File

Last response: in Windows 7
Share
March 21, 2013 1:25:21 PM

Hi, I have a batch file that is being called using call filename.bat
What I am wondering is, is it possible to have a line of code at the end of the filename.bat that automatically saves it when the user has been prompted and entered the two pieces of required information?

More about : msdos batch file

a b $ Windows 7
March 21, 2013 1:39:36 PM

If you're going to prompt during the file execution, you need to use some other program to save the data. Back in the day, I used to do this with little Turbo Pascal routines, but that is unfortunately no longer an option. You can probably use VBScript, but I am no longer a programmer and am not familiar enough with it.
a b $ Windows 7
March 21, 2013 1:39:42 PM

the ">" filename.txt(bat should work) can save whatever the last command was, but I have not messed with dos too much as of late.

">>" can append to a file that already has text in it.

What exactly are you trying to do? Maybe someone here can play around in the command prompt to try to help you out.
March 21, 2013 2:02:32 PM

nukemaster said:
the ">" filename.txt(bat should work) can save whatever the last command was, but I have not messed with dos too much as of late.

">>" can append to a file that already has text in it.

What exactly are you trying to do? Maybe someone here can play around in the command prompt to try to help you out.



I am wanting to set up a call from a batch file which calls another batch file, within this second batch file are two questions enter source path and enter destination path to copy from and too, what I was then hoping was that the two user inputs could be saved into this second batch file that is called and then from the main batch file, I could assign this edited batch file to say a menu option no.3 and then automatically does the back up without asking the user for anymore information.

!