Question WinRAR Command: Do Not Delete?

raywood

Distinguished
Jul 25, 2007
18
0
18,510
I ran this command:

"C:\Program Files\WinRAR\WinRAR.exe" a -r -s -ep1 "[target filename].rar" "%appdata%\Thunderbird\Profiles"

It created the .rar file - and then deleted the Thunderbird Profiles source folder. Is that the expected behavior?

I thought it defaulted to not delete. WinRAR's Help feature indicates that a -df deletes files after archiving. I didn't use that. I don't see a switch that explicitly preserves files from not being deleted. I don't want it to delete.
 

Ralston18

Titan
Moderator
What is the purpose (or believed purpose) of that lone "a" in your script?

Is that script actual script that was copied and pasted into your original post? Or directly typed into the post?

= = = =

In the switch list I see -a__, -r, -s, and some -ep___ as well.

There are eight " -a__ " switches but not just an "a" or "-a" if I am following correctly.

Because "a" switches seem to involve attributes and archives perhaps the "a" is making or causing some attribute change and something else, in turn, deletes the file(s).

If you have a safe test environment, add -dr to your script. Determine if the original files do indeed end up in the Recycle Bin.

Double check for typos and/or syntax errors.
 

raywood

Distinguished
Jul 25, 2007
18
0
18,510
An exchange of email with the developer suggests that the user's chosen settings, in the WinRAR GUI, are also the default settings for the command line. So the primary question is not what I've specified on the command line; it is what I've specified in the GUI (or in the rar.ini file, or in the RAR environment variable).

In the GUI, I have set WinRAR to delete by default after creating an archive. I can change that in the GUI. It appears there is no option to change that or other discrete settings on the command line; I can only use -cfg- to ignore all default settings. I'm not entirely sure how that would work for the various things I have configured in the GUI, but at least apparently it would cease to delete the source files after creating the .rar archive.

For my purposes, the solution seems to be to set my batch file to create a copy of the Thunderbird profile folder first, and then use the WinRAR command to archive that copy.