The purpose is like this:
I have many folders in the current directory, and different folders and files are placed in them, with sizes ranging from a few megabytes to hundreds of megabytes. I just want to take the current directory as the benchmark, enter the directory, compress, make a self-extracting archive, delete the compressed archive, exit the folder, and so on in a loop until all folders are compressed. The environment variables for calling WinRAR and the relevant WinRAR parameters have been set (because it is set to take effect for the graphical interface, so it must be done by calling WinRAR), and it can be called directly. This is what I wrote: for /f %a in ('dir /b') do cd %a &winrar a -r x:\%a.rar&winrar s x:\%a.rar&del x:\%a.rar&cd.. That's it. But in the actual execution process, the second WinRAR command is executed before the first one is finished! Because the workload is very large, so I'm really troubled. Please give me some advice. I have repeatedly experimented many times. Using the echo statement to generate a batch file must work, but I want to go further and just have one command, expert advice. Thank you!
[ Last edited by txtrain on 2007-2-6 at 10:15 AM ]
I have many folders in the current directory, and different folders and files are placed in them, with sizes ranging from a few megabytes to hundreds of megabytes. I just want to take the current directory as the benchmark, enter the directory, compress, make a self-extracting archive, delete the compressed archive, exit the folder, and so on in a loop until all folders are compressed. The environment variables for calling WinRAR and the relevant WinRAR parameters have been set (because it is set to take effect for the graphical interface, so it must be done by calling WinRAR), and it can be called directly. This is what I wrote: for /f %a in ('dir /b') do cd %a &winrar a -r x:\%a.rar&winrar s x:\%a.rar&del x:\%a.rar&cd.. That's it. But in the actual execution process, the second WinRAR command is executed before the first one is finished! Because the workload is very large, so I'm really troubled. Please give me some advice. I have repeatedly experimented many times. Using the echo statement to generate a batch file must work, but I want to go further and just have one command, expert advice. Thank you!
[ Last edited by txtrain on 2007-2-6 at 10:15 AM ]
