The PowerShell escaping problem has been fixed! Here are all available methods:
# Most reliable method - works on all Windows versions
create_shortcut_fixed.batAdvantages:
- ✅ Works on Windows 7-11
- ✅ No PowerShell execution policy issues
- ✅ Robust error handling
# For modern Windows systems
powershell -ExecutionPolicy Bypass -File "Create-Shortcut.ps1"Advantages:
- ✅ Native PowerShell
- ✅ Better error handling
- ✅ Detailed output
# Original batch file - now repaired
create_shortcut.batChange:
# Old (broken):
powershell -Command "$WshShell = ..."
# New (works):
powershell -Command "& {$WshShell = ...}"| File | Method | Compatibility | Recommendation |
|---|---|---|---|
create_shortcut_fixed.bat |
VBScript | Windows 7-11 | ✅ Best |
Create-Shortcut.ps1 |
PowerShell | Windows 10+ | ✅ Modern |
create_shortcut.bat |
PowerShell | Windows 10+ | ✅ Repaired |
# Run once:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Or bypass directly:
powershell -ExecutionPolicy Bypass -File "Create-Shortcut.ps1"- Add Windows Defender exception
- Or create shortcut manually
- Right-click on Desktop → "New" → "Shortcut"
- Enter path:
C:\Path\to\VisoLingua.exe - Name: "VisoLingua"
- Finish
# 1. Build EXE
python build_exe.py
# 2. Change to dist/ directory
cd dist
# 3. Create shortcut (best method)
..\create_shortcut_fixed.bat# Create portable package (contains all shortcut creators)
create_portable.bat
# In package then:
cd VisoLingua-Portable
"Create Desktop Shortcut.bat" # Uses VBScript method# Problem: ^ character doesn't work in PowerShell
powershell -Command "...(^)..." # ❌ Error
# Solution: Use & {} block
powershell -Command "& {...()...}" # ✅ Works- ✅ VBScript fallback for maximum compatibility
- ✅ Error handling in all versions
- ✅ Path validation before shortcut creation
- ✅ Cleanup of temporary files
For maximum compatibility: Use create_shortcut_fixed.bat
For modern systems: Use Create-Shortcut.ps1
Both methods are now fully functional! 🎉