Avatar of ddantes
ddantes
Flag for United States of America asked on

Batch editing shortcut targets

Running Windows 7 Professional SP-1, I have just converted over a thousand .wps files to .docx.   However, now there are hundreds of shorcuts, in myriad folders, which point to non-existent .wps files.  I would like to batch edit these links, to point them to the new .docx files.  The application which I usually rely upon, Shortcut Doctor, is not performing, for some reason.  It finds all the references to .wps in shortcut links, but will not change them to .docx (it doesn't find them again, during the Replace process, although it found them during the Search process).  Is there an application or a script which I can use, which will locate all these shortcuts and update them?
Windows 7Visual Basic ClassicVB Script

Avatar of undefined
Last Comment
ddantes

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
shorvath

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ddantes

ASKER
Thank you for that script.  Sorry for my ignorance, but how should I apply that?  In other words, what is needed in order to execute that?
ddantes

ASKER
I think I found out how to run the script.  I get this error:
(7, 14) Microsoft VBScript compilation error: Expected end of statement
SOLUTION
RobSampson

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Bill Prew

Are these LNK files that you need to update?

Do you want the script to only process the files in a specified folder, or do you want it to search all subfolders as well?

Do you want it to verify that the target file (with the WPS extension) exists before the change, and only update the link if true?

~bp
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
shorvath

Sorry, but I saw this question under the VB Classic Group.   I did run this with VB6 and it worked.  It did rename the Target File in the .lnk file, and then renamed the Shortcut itself to reflect the new file name. I did assume that the Target path of the file and the file name has NOT changed, only the extension. ( .wps to .docx)  I will be back at work next week to test it under Windows 7, VB script, but the logic is sound and working.
ddantes

ASKER
Rob:  Thank you for your instructions.  I pasted the code into a new Excel module, added the Refererences, but I don't know how to run it.  When I select "Run", it asks for a macro name.
ddantes

ASKER
Never mind, I worked it out.  Thank you for the code and implementation instructions -- works like a charm!
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ddantes

ASKER
(Deleted)