sebbu

Update lnk

Apr 20th, 2026 (edited)
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env pwsh -command
  2. get-childitem -Attributes Directory -Exclude @("_zip","_saves") |
  3.         foreach-object {
  4.                 cd $_ ;
  5.                 get-childitem -filter "*.lnk" |
  6.                         foreach-object {
  7.                                 $l=$s.CreateShortcut($_.FullName);
  8.                                 $l.TargetPath = $l.TargetPath | foreach {$_.replace("G:\nwjs","C:\nwjs")};
  9.                                 $l.TargetPath = $l.TargetPath | foreach {$_.replace("D:\nwjs","C:\nwjs")};
  10.                                 $l.WorkingDirectory = $l.WorkingDirectory | foreach {$_.replace("G:\nwjs","C:\nwjs")};
  11.                                 $l.WorkingDirectory = $l.WorkingDirectory | foreach {$_.replace("D:\nwjs","C:\nwjs")};
  12.                                 $l.Save()
  13.                         };
  14.                 cd ..
  15.         }
  16. echo done
  17.  
Advertisement
Add Comment
Please, Sign In to add comment