Create a batch file to archive all subfolder in the folder d:\MyData and move it to d:\MyDataArchvies using winrar archive tool
To create a batch file to archive all subfolders in the folder d:\MyData
and move it to d:\MyDataArchives
using the winrar
archive tool, you can use the following steps:
- Open a text editor, such as Notepad, and type the following commands:
Save the file as
archive-mydata.bat
in the folderd:\MyData
.To run the batch file, double-click on it or open a command prompt and navigate to the
d:\MyData
folder and typearchive-mydata.bat
. This will create a.rar
archive file for each subfolder in thed:\MyData
folder and move it to thed:\MyDataArchives
folder.
Note: The above instructions assume that the winrar
executable is installed in the default location (C:\Program Files\WinRAR\Rar.exe
). If it is installed in a different location, you will need to update the path in the batch file accordingly. Additionally, the -ep1
and -inul
flags in the Rar.exe
command are used to exclude the parent directory and prevent displaying any messages during the archiving process.
Comments
Post a Comment