Operating Systems 1 Lab 4 – DOS Batch File Creation
This weeks lab #4, we make a .bat file that will automatically take any .txt file with the name "ReallyImportantProgram" and any number in front of e.g. 1 or 2 etc.., and it will put it into a folder called BackupFolder.
First we create two text files and put text into it.
We then make a .bat file and put this code into it
" mkdir
BackupFolder
copy ReallyImportant*.txt BackupFolder
dir BackupFolder "
When this bat file is run it will put the two text files created into a folder called BackupFolder.
The one problem I found is with the instruction, we were told to type in "Type
in MakeABackup",
This did not work for me and I don't think it will work for anyone at all since MakeABackup is not recognised by cmd. What will work though is, typing in BackupFolder or BackupFolder.bat, this will call the .bat file and run it.
Comments
Post a Comment