A Go program that moves Windows applications/directories and automatically fixes registry entries, shortcuts, environment variables, and configuration files pointing to the old location.
ALL codes are vibed!
- Move files/directories: Safely relocate programs with automatic rollback on failure
- Registry scanning & fixing: Finds and updates Windows registry entries pointing to old paths
- Shortcut repair: Updates
.lnkfiles with new target paths - PATH environment updates: Modifies user/system PATH variables
- Configuration file scanning: Updates config files containing old paths
- Admin privilege handling: Automatically elevates with UAC prompt when needed
- Fixed whitespace handling: Properly escapes paths with spaces during elevation
- Color support detection: ANSI colors only when terminal supports VT processing
- Integrated registry backups: Single
.regfile instead of multiple files - Operation logging: Complete log of all actions in backup directory
- Debug mode: View PowerShell elevation commands without executing
- Parallel scanning: Optimized performance with concurrent registry/shortcut scanning
- Go 1.24.0 or higher
- Windows 10+ (for color support, works on Windows 7+ without colors)
cd AntsMoving
go build -o antsmoving.exegolang.org/x/sys/windows- Windows API accessgolang.org/x/sys/windows/registry- Registry operationsgolang.org/x/term- Terminal detection
antsmoving.exe -from <source> -to <destination> [options]# Scan for references without making changes
antsmoving.exe -from "D:\OldApp" -to "E:\NewApp" -scan
# Preview changes (dry-run)
antsmoving.exe -from "C:\Program Files\App" -to "D:\Apps\App" -dry-run
# Execute with automatic backup
antsmoving.exe -from "C:\OldPath" -to "C:\NewPath" -backup "C:\Backup"
# Skip confirmation prompts
antsmoving.exe -from "D:\App" -to "E:\App" -yes
# Debug elevation command
antsmoving.exe -from "D:\Nmap" -to "D:\Program Files\Nmap" -debug-from string Source directory or file to move (required)
-to string Destination directory (required)
-backup string Backup directory for changed files (default: temp dir)
-silent Silent mode - minimal output
-dry-run Preview changes without applying them
-scan Only scan for references without moving
-yes Skip confirmation prompts (auto-accept)
-debug Debug mode: print PowerShell elevation command and exit
- Registry: Scans common registry locations (HKLM\SOFTWARE, HKCU\SOFTWARE, etc.)
- Shortcuts: Searches Start Menu, Desktop, and common locations
- PATH: Checks user and system environment variables
- Config files: Scans common config file types (.json, .ini, .xml, .yaml, etc.)
- Registry backup: Creates single
registry_backup.regfile - Shortcut backup: Copies original
.lnkfiles - Operation log: Creates
operation.logwith complete history
- Moves files/directories (with cross-device copy support)
- Updates registry entries with new paths
- Repairs shortcuts with updated targets
- Modifies PATH environment variables
- Updates configuration files
- Restores registry from backup
.regfile - Restores original shortcuts
- Moves files back to original location
- Checks
NO_COLORenvironment variable - Verifies terminal supports ANSI colors
- Windows-specific: Enables
ENABLE_VIRTUAL_TERMINAL_PROCESSINGconsole mode - Falls back to monochrome output if VT processing not available
- Uses PowerShell
Start-Process -Verb RunAs - Properly escapes command line arguments with Windows quoting rules
- Handles paths with spaces correctly (e.g.,
"D:\Program Files\App") - Provides detailed error messages if elevation fails
- Parallel scanning with worker pool
- Prioritizes common registry locations
- Case-insensitive matching
- 10-minute timeout for deep scans
[HH:MM:SS] [LEVEL] Message: Details
- Colors: Red (ERROR), Yellow (WARN), Green (OK/SUCCESS), Gray (INFO), Blue (DEBUG)
- File logging: JSON format to
antsmoving.login temp directory - Backup logging: Plain text to
operation.login backup directory
- Registry permissions: Some keys may be read-only
- Shortcut parsing: Uses PowerShell fallback for LNK file parsing
- System PATH: Requires admin privileges for system-wide changes
- Running processes: Programs using moved files may need restart
- Windows services: Services may need reconfiguration
# Basic functionality
antsmoving.exe -from test_source -to "test dest with spaces" -dry-run
# Admin elevation simulation
antsmoving.exe -from "D:\iMonitor" -to "D:\Program Files\iMonitor" -debug
# Backup functionality
antsmoving.exe -from source -to destination -backup test_backup -scanThis project is for educational and practical use. See source code for details.
- Report issues with detailed error messages and test cases
- Include
-debugoutput when reporting elevation problems - Test with
-dry-runbefore actual execution - Backup important data before testing