Thanks Shades for the script. I have d/l it and have edited the script to the best of my ability. But the script doesn't complete. see attached screenshot. I am placing the script here too. I think it is line 48(last line before the pause) that needs to be edited but I don't know what to.
@ECHO off
REM --- Purpose of script: automatically create small 7-zip archive from latest files on USB stick. -----------------------------
REM -----------------------------------------------------------------------------------------------------------------------------
REM --- 01. - Type which drive letter is assigned to USB stick. -----------------------------------------------------------------
ECHO -
ECHO step 1: Type drive letter assigned to USB stick, for example: C
ECHO ---------------------------------------------------------------------
ECHO
SET /P driveLetter=[USB drive letter]
REM GOTO :EOF
GOTO Step2
REM
REM -----------------------------------------------------------------------------------------------------------------------------
REM --- 02. - Initializing the folders for getting and creating the archives (user definable). ----------------------------------
:Step2
ECHO -
ECHO step 2: Initializing required parameters
ECHO ---------------------------------------------------------------------
REM --- note: date notation depends on regional settings from the system the script is executed on (current = Dutch!). ----------
REM --- current = Dutch on WinXP US ---------------------------------------------------------------------------------------------
SET year=%date:~9,4%
SET month=%date:~6,2%
SET day=%date:~3,2%
REM --- current = US on WinXP US ------------------------------------------------------------------------------------------------
REM SET year=%date:~10,4%
REM SET month=%date:~7,2%
REM SET day=%date:~4,2%
REM --- current = US on WinXP NL ------------------------------------------------------------------------------------------------
REM SET year=%date:~6,4%
REM SET month=%date:~3,2%
REM SET day=%date:~0,2%
REM --- the order from the work date should always be the same (according to my preference) -------------------------------------
SET workDate=%year%-%month%-%day%
SET usbFolder="%driveLetter%:\"
SET archiveFolder=C:\Kingston Backup 16gb
SET recentArchive=%archiveFolder%\USB_%workDate%
ECHO USB drive: %usbFolder%
ECHO Archive file and path: %recentArchive%
REM GOTO :EOF
GOTO Step3
REM
REM -----------------------------------------------------------------------------------------------------------------------------
REM --- 03 - Create the archive in the archive folder (-mx=9 is most extreme setting). ------------------------------------------
:Step3
ECHO -
ECHO step 3: Creating archive %recentArchive%
ECHO ---------------------------------------------------------------------
"%driveLetter%:\7-ZipPortable\App\7-zip\7z.exe" a -t7z %recentArchive%.7z %driveLetter%:\* -w%archiveFolder% -mx=9
pause