Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for notrkico.bat

(view source code of notrkico.bat as plain text)

  1. @ECHO OFF
  2. ECHO.
  3. ECHO NoTrkIco.bat,  Version 1.00 for Windows (32-bit)
  4. ECHO Disable "smart shortcuts" or "icon tracking" on the local PC
  5. ECHO.
  6. ECHO Icon tracking means shortcuts keep their original path in UNC format;
  7. ECHO copying a shortcut file from one PC to another may lead to extremely
  8. ECHO slow applications, because they are actually running on the computer
  9. ECHO where the shortcut was created originally.
  10. ECHO Individual shortcuts may be "restored" by using a utility called
  11. ECHO "SCUT.EXE".
  12. ECHO However, this batch file adds a registry setting that will cause
  13. ECHO the computer to completely ignore the UNC path of ANY shortcut.
  14. ECHO.
  15. ECHO Written by Rob van der Woude
  16. ECHO http://www.robvanderwoude.com
  17. ECHO Based on a tip by Sander Jousma
  18. ECHO.
  19. ECHO Press any key to disable icon tracking, or Ctrl+C to abort . . .
  20. PAUSE >NUL
  21.  
  22. :: Create temporary .REG file
  23. > "%Temp%.\_NoTrack.reg" ECHO REGEDIT4
  24. >>"%Temp%.\_NoTrack.reg" ECHO.
  25. >>"%Temp%.\_NoTrack.reg" ECHO [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\LinkResolve]
  26. >>"%Temp%.\_NoTrack.reg" ECHO "IgnoreLinkInfo"=dword:00000001
  27. >>"%Temp%.\_NoTrack.reg" ECHO.
  28.  
  29. :: Add a dummy title for Windows NT 4 or 2000
  30. SET Title=
  31. IF "%OS%"=="Windows_NT" SET Title="Regedit"
  32. :: Merge temporary .REG file
  33. START /WAIT %Title% REGEDIT.EXE /S "%Temp%.\_NoTrack.reg"
  34.  
  35. :: Cleanup
  36. DEL "%Temp%.\_NoTrack.reg"
  37. SET Title=
  38.  

page last modified: 2024-04-16; loaded in 0.0072 seconds