× Loading
Saleen Software Solutions
     Our Lord is coming back in X days Y hours Z minutes and V seconds. Are you prepared?
    Professional software development
 
|
|
|
Login / Register
Check all your programs
for updates.





   Saleen Software  >  Forums  >  Folder Sync  > 
0
Wrapper to embed the usage function
Other Other
Open
Post a reply / Write a message here

1000063.png stuck1a
2022-08-10 18:54:03⁼

Here is a short wrapper script to embed the usage function. I've adjusted the examples a bit.



::
:: ---------------------------------------------
:: Wrapper for Saleen Software's FolderSync.exe
:: ---------------------------------------------
:: Adds an (extended) usage function
:: written by stuck1a
::

::
:: Adjust the path to where your FolderSync.exe is actually located
:: and save this script to any location your PATH variable points to
:: (for example C:\Windows\system32\foldersync.bat)
::
@ECHO OFF
SET exepath="E:\Programme\FilesystemUtilities\FolderSync\FolderSync.exe"
::

::
:: DO NOT EDIT ANYTHING BELOW THIS LINE
:: -------------------------------------------------------------------------
IF "%1"=="" (
  CALL :usage
  GOTO exitscript
)
IF /I "%1"=="gui" (
  CALL %exepath%
  GOTO exitscript
)
START %exepath% %*
GOTO exitscript
:usage
ECHO.
ECHO FolderSync - automatic synchronization of files and folders
ECHO.
ECHO SYNOPSIS:
ECHO     - Performs comparisons between two directories
ECHO     - Reports new, updated, renamed, moved and deleted files
ECHO     - Performs synchronization from the source to the destination path
ECHO     - Can be used for differential or full backups.
ECHO.
ECHO GUI:
ECHO     Easily perform comparisons between directories and reports
ECHO     new, updated, renamed, moved and deleted files.
ECHO     You can also generate synchronization commands.
ECHO     (one-way only: right to left)
ECHO.
ECHO USAGE:
ECHO     foldersync [Source Path] [Destination Path] [Parameters]
ECHO.
ECHO ARGUMENTS:
ECHO     gui            Open GUI
ECHO     +Identical     Show identical files
ECHO     -Identical     Hide identical files   (DEFAULT)
ECHO     +New           Show new files         (DEFAULT)
ECHO     -New           Hide new files
ECHO     +Deleted       Show deleted files     (DEFAULT)
ECHO     -Deleted       Hide deleted files
ECHO     +Updated       Show updated files     (DEFAULT)
ECHO     -Updated       Hide updated files
ECHO     +Moved         Show moved files       (DEFAULT)
ECHO     -Moved         Hide moved files
ECHO     /tolerance=N   Set modification date tolerance to N seconds
ECHO     /start_sync    Automatically start synchronization
ECHO     /auto_close    Automatically close after synchronization
ECHO     /filter        Include/Exclude filters
ECHO                    Use "/filter1 filter2 ..." for multiple filter
ECHO                    Prefix a filter with a dash (-) for exclusions
ECHO.
ECHO EXAMPLES:
ECHO     (1) Sync files from "src" to "build" without ".git" in filename
ECHO     foldersync "./src" "./build" /-.git /start_sync /auto_close
ECHO.    
ECHO     (2) List files which exist in "src" but not in "build"
ECHO     foldersync "./src" "./build" +Deleted -Updated
ECHO.
ECHO     (3) List all changed files since last synchronization
ECHO     foldersync "./src" "./build"
:exitscript
@ECHO ON


  Copyright (c) 2007-2022 Saleen Software       2022-09-30 21:53:56