I would hesitate to use Notepad to edit any shortcut as its text capabilities simply will not handle the binary and unicode entries within a .LNK shortcut.
If you are going to write a script, then perhaps writing a proper .VBS script would be the way to go. The following snippet enumerates a folder called C:\Shortcuts for .LNK files and displays their filenames and shortcut target paths. Any file with out an .LNK extension is displayed within brackets. I'm supplying this simple code snippet so you can get an idea of the VBS scripting capabilities. You were not very specific on what you intended to do with the shortcut beyond a path edit. A VBSReplace command should be able to handle general editing like that.
objStartFolder = "C:\Shortcuts"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(objStartFolder)
Set colFiles = objFolder.Files
For Each objFile in colFiles
If Right(objFile.Name, 4) = ".lnk" Then
Set sh = CreateObject("WScript.Shell")
Set shortcut = sh.CreateShortcut(objStartFolder & "" & objFile.Name)
Wscript.Echo objFile.Name & Chr(10) & shortcut.TargetPath
shortcut.Save
Else
Wscript.Echo "(" & objFile.Name & ")"
End If
Next
To run this simply copy the code into a blank Notepad text file and save it as*<something>*.vbs. Edit the C:\Shortcuts entry for your own purposes. Double click to run it or from a command line. For more information see,
CreateShortcut Method
http://msdn.microsoft.com/en-us/library/xsy6k3ys(v=vs.85).aspx
- If this proposed solution has resolved your issue(s), please return and mark it as Answered for others to consider.