Anbei die Lösung über den VBS*****-Weg:
Code:
Option Explicit
Dim WSHShell, oFSO, oFolder, oFiles, oFile, strOldPath, strNewPath, lnkName, myShortcut
Dim strTarget, strWorkD, strWDRep, strRep, crLnk, strFolder, subFiles
Set WSHShell = WS*****.CreateObject("WS*****.Shell")
Set oFSO = WS*****.CreateObject("S*****ing.FileSystemObject")
strFolder = InputBox("Bitte den Pfad zu den Verknüpfungen eingeben." & vbCrLf & "z.B. C:\Users\Admin\Desktop\spiele")
strOldPath = InputBox("Bitte den alten Pfad angeben, indem die Spiele vorher installiert waren." & vbCrLf & "z.B. C:\Games")
strNewPath = InputBox("Bitte den neuen Pfad angeben, indem die Spiele jetzt installiert sind." & vbCrLf & "z.B. E:\Games")
If strFolder = "" Then
MsgBox "Keine Eingabe. Beende!", vbOKOnly, "Error"
Ws*****.Quit
End If
If strOldPath = "" Then
MsgBox "Keine Eingabe. Beende!", vbOKOnly, "Error"
Ws*****.Quit
End If
If strNewPath = "" Then
MsgBox "Keine Eingabe. Beende!", vbOKOnly, "Error"
Ws*****.Quit
End If
If oFSO.FolderExists(strFolder) Then
For Each oFolder In oFSO.GetFolder(strFolder).SubFolders
For Each oFile In oFolder.Files
If UCASE(Right(oFile.Path,4)) = ".LNK" then
'Managing old LNK-Files
lnkName = oFolder & "\" & oFile.Name
Set myShortcut = WSHShell.CreateShortcut(oFile.Path)
strTarget = myShortcut.targetpath
strWorkD = myShortcut.WorkingDirectory
strWDRep = Replace(strWorkD, strOldPath, strNewPath)
strRep = Replace(strtarget, strOldPath, strNewpath)
oFSO.DeleteFile lnkName
'Creating new LNK-File
Set crLnk = WSHShell.CreateShortcut(lnkName)
crLnk.TargetPath = strRep
crLnk.WorkingDirectory = strWDRep
crLnk.save
End If
Next
Next
Else
MsgBox "Der Pfad """ & strFolder & """ existiert nicht." & vbcrlf & "Bitte überprüfen Sie die Pfadangabe zu den Verknüpfungen", vbOKOnly, "Error"
End If
VG,
haze303