-
Notifications
You must be signed in to change notification settings - Fork 0
Smart Routing
official-Arvind edited this page Jun 19, 2026
·
2 revisions
Windows filesystems have a legacy limitation of 260 characters for file paths (MAX_PATH). Android devices (running on a Linux-based kernel) do not have this restriction. If you attempt to sync deeply nested Android folders directly to Windows, long file names or deeply nested paths will cause standard backup applications to fail with path-too-long errors.
- At script startup,
JigarSmartSync.ps1dynamically checks for the first available drive letter starting fromZ:and going backward (Z:,Y:,X:, etc.). - Once an unused letter is found (e.g.
Z:), the script runs the Windowssubstcommand to map the local destination folder directly to that drive letter:subst Z: "D:\Backups\My_Backup_Folder"
- During the backup, the target path is treated as
Z:\, reducing the character path prefix length to just 3 characters! This saves up to 240+ characters of path length and preventsMAX_PATHerrors. - When the script exits or is aborted, it automatically unmounts the virtual drive:
subst Z: /D
-
Lock Detection: If a file on
Z:is currently in use by Windows Explorer, the unmount command might fail. Jigar Tools runs a 5-iteration retry loop with a 200ms sleep to wait for locks to clear. - Auto-Cleanup at Startup: If a virtual drive was left mapped due to an abrupt terminal closure, the next run of the Sync or Restore tool automatically parses current mappings and unmounts them if they point to your backup directories.