So far this script I got from another thread has worked perfectly for me:
Code: Select all
oldDir := "K:", newDir := "H:"
Loop, Files, %A_ScriptDir%\*.lnk
{ FileGetShortcut, %A_LoopFilePath%, target, dir, args, desc, icon, iconNum, state
If (target ~= oldDir)
FileCreateShortcut, % StrReplace(target, oldDir, newDir), %A_LoopFilePath%
, % StrReplace(dir , oldDir, newDir)
, %args%, %desc%, %icon%,, %iconNum%, %state%
}
MsgBox, 64, Done, Done!
I have in same folder several shortcuts with different paths, and I just need to batch update fields "target" and "start in" within all .lnk files starting with the path "C:\Apps\*" to "H:\Apps\*", not affecting for instance .lnk with "C:\Program Files\*".
For instance, the link fields Traget and Start in would change to "H:\Apps\App.exe" would change to "H:\Apps\" respectivelly.
Could it be achieved?
Thank you!