Saved Bookmarks
| 1. |
Solve : want to copy/rename a particular file to desires name using batch file while run? |
|
Answer» Dear sir,
C:\test>type ravi.bat @echo off copy c:\temp\data.rtf c:\test\desirename.rtf Output: C:\test>ravi.bat 1 file(s) copied. C:\test>dir desire* | findstr "desire" 07/04/2010 12:14 PM 9 desirename.rtf C:\test>Quote from: marvinengland on July 04, 2010, 11:20:50 AM C:\test>type ravi.bat question: in this batch file it seems you would have to enter the desired name into the batch file while you are creating the batch file, i.e. before loading the display that you will want to save the temp file from. How could one program interaction into he batch file instead, whereby each time a display was finished, the temp file would be saved with a new name that you would decide and enter while the batch file itself is running?Quote from: KB5cmd on July 05, 2010, 06:00:53 PM question: in this batch file it seems you would have to enter the desired name into the batch file while you are creating the batch file, i.e. before loading the display that you will want to save the temp file from. With a commandline argument or prompt the user for the name. I will show an EXAMPLE of each shortly. C:\test>type ravi.bat @echo off copy c:\temp\data.rtf c:\test\%1.rtf Output: C:\test> ravi.bat newname 1 file(s) copied. C:\test>dir *.rtf | findstr "newname" 07/04/2010 12:14 PM 9 newname.rtf C:\test> _________________________________ C:\test>type ravi2.bat @echo off set /p name=Enter name: copy c:\temp\data.rtf c:\test\%name%.rtf C:\test>ravi2.bat Enter name: ravname 1 file(s) copied. C:\test>dir /tc ravname.rtf | findstr "ravname" 07/05/2010 08:31 PM 9 ravname.rtf C:\test> |
|