The switch -ilog
writes only errors to the specified log file as it is described by the help of WinRAR. The file is not created at all if no error occurred on WinRAR operation.
The help page of this switch can be opened with English WinRAR as follows:
- Start WinRAR.
- Click in last main menu Help on first menu item Help topics.
- Expand on first tab Contents the list item Command line mode.
- Expand the list item Switches.
- Click on list item "-ilog[name]" - write errors to file.
The manual for the console version Rar.exe
is the text file Rar.txt
which is stored in the program files folder of WinRAR. It explains the general syntax, the RAR commands and the switches which can be used with Rar.exe
and the exit values.
Most switches are supported by WinRAR.exe
and Rar.exe
, but some switches are supported only by Rar.exe
while other switches are supported only by WinRAR.exe
. So it is advisable to read either Rar.txt
on using Rar.exe
or the WinRAR help (file WinRAR.chm
) on using WinRAR.exe
.
The square brackets [
and ]
around the name is the syntax for an optional string which is in this case the file name of the log file without or with a path.
English Rar.txt
describes for the option -ilog
:
-ilog[name]
Log errors to file.
Write error messages to rar.log file. If optional 'name'
parameter is not specified, the log file is created
using the following defaults:
Unix: .rarlog file in the user's home directory;
Windows: rar.log file in %APPDATA%\WinRAR directory.
If 'name' parameter includes a file name without path,
RAR will create the log file in the default directory
mentioned above using the specified name. Include both path
and name to 'name' parameter if you wish to change
the location of log file.
By default, log file uses UTF-16 little endian encoding,
but it can be changed with -sc<charset>g switch, such as -scag
for native single byte encoding.
Example:
rar a -ilogc:\log\backup.log backup d:\docs
will create c:\log\backup.log log file in case of errors.
So the usage of just -ilog
without file name results in writing the error messages into file rar.log
in directory %APPDATA%\WinRAR
on Windows or in program files directory of WinRAR on not using a WinRAR application data directory and the program files directory of WinRAR is not write-protected for the current user.
-ilogError.txt
writes the error messages into the file Error.txt
in the current directory.
If the file name without or with path contains a space or one of these characters &()[]{}^=;!'+,`~
, the entire switch or the entire file name must be enclosed in "
. For example, if the error message should be written into the file Errors.txt
in already existing directory C:\Temp\Development & Test(!)
, there must be used either
"-ilogC:\Temp\Development & Test(!)\Errors.txt"
or
-ilog"C:\Temp\Development & Test(!)\Errors.txt"
Enclosing the entire switch in double quotes is the recommended syntax.