
- #So where are you loose ends rar manual#
- #So where are you loose ends rar archive#
- #So where are you loose ends rar rar#
- #So where are you loose ends rar code#
- #So where are you loose ends rar windows#
So let us put all these information together to a new batch file: off
#So where are you loose ends rar code#
exit code is lower than 1 which means equal 0 as Rar.exe never exits with a negative value as nearly all applications and commands. If not errorlevel 1 is the opposite, i.e. So it is possible to check if any error occurred with if errorlevel 1 which means if exit code is greater or equal 1 as described by help of command IF output on running in a command prompt window if /?.
#So where are you loose ends rar manual#
The manual Rar.txt contains near bottom the possible exit codes. There is no need to create it in current directory and next move the file to destination directory.
#So where are you loose ends rar archive#
Rar.exe can create the archive file in any existing directory. See also Simply compress 1 folder in batch with WinRAR command line? for an explanation why the specified folder path in batch file code below ends with a backslash. For that reason just * or no wildcard at end of folder path of the folder to archive should be used as * is the default on no wildcard used.

It looks like a directory should be recursively added to an archive with updating existing files in archive and with excluding two directories. *.* means really the file to add to the archive must have a dot in its file name or Rar.exe ignores the file.
#So where are you loose ends rar windows#
Next the manual of Rar.exe describes that *.* is not interpreted like * as Windows command processor does. command line is not needed at all making the batch code below independent on region setting of used account. It is interesting to see that switch -ag is used with HH-MM although Rar.exe supports also appending not only current hour and minute, but also current date in a customizable format with using -ag to archive file name before file extension.
#So where are you loose ends rar rar#
So all created archives are RAR and not ZIP archives although the file extension is. It can be read at top of this text file that Rar.exe supports only RAR archive file format. The manual for console version Rar.exe is the text file Rar.txt in program files folder of WinRAR. The third mistake is using Rar.exe with specifying file extension. See also: Why does %date% produce a different result in batch file executed as scheduled task? So getDate is Tu-, -9/25 instead of 25-09-2018 and / is interpreted as directory separator like \ which is the real directory separator on Windows.įor that reason Jenkins_%gerDate%_.zip becomes on execution by Jenkins Jenkins_Tu-, -9/25_.zip and Rar.exe can't find in current directory the subdirectory Jenkins_Tu-, -9 to create the file 25_HH-mm.zip in this directory. īut Jenkins runs as service with system account which is most likely using a different date format like for example English U.S. I suppose that for your user account the country Germany is configured resulting in the date format dd.MM.yyyy which means.

This line is most likely the real problem. The second mistake is the entire line: set gerDate=%date:~0,2%-%date:~3,2%-%date:~6,4% See also Why is no string output with 'echo %var%' after using 'set var = text' on command line? for an explanation why there is one " left the environment variable name and one more " at end of the argument string.

However, this line is not really the problem and of course is also not needed at all as it can be seen on the batch file code below. A folder path should be also without backslash at end. The first mistake is in line: set path="C:\Program Files\WinRAR\" %path%Ĭorrect would be set "path=C:\Program Files\WinRAR %path%"Ī folder path in semicolon separated list of folder paths assigned to environment variable PATH should not be enclosed in double quotes except the folder path contains one or more semicolons.

rar is not generated even within Temp folder, so that might not be the case as well. rar with cmd's command "move" into different folder, it might be causing my problems. I've noticed that my script is being temporary stored in C:\Users\\AppData\Local\Temp and since the script has to move the compressed. Set path="C:\Program Files\WinRAR\" %path% However, running the script locally with user-interaction is working just fine! off &color 1f & Title Everything is working without a hitch, but once I set up my build with " Execute Windows batch command" the batch file will fail saying "File already exist, or couldn't be found (loose translation from German). I've created simple batch file, that backs up my Jenkins directory.
