Click here to Skip to main content
15,883,817 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all ,

I have a program installed on my machine now what I want is to write a script(batch file ,vb script anything)which can serve the following purpose .
The target path of the shortcut on the desktop shows "
C:\XYZ\abc.exe"
Now I want to change it to C:\XYZ\bbc.exe
How can I perform that ?

Thanks all
Posted
Updated 21-Mar-14 17:59pm
v3
Comments
CoderPanda 21-Mar-14 8:00am    
which language?
what is the usage - will you add it to your app-installer or use independently or something else?
iampradeepsharma 21-Mar-14 23:59pm    
I have a program installed on my machine now what I want is to write a script(batch file ,vb script anything)which can serve the following purpose .
The target path of the shortcut on the desktop shows "
C:\XYZ\abc.exe"
Now I want to change it to C:\XYZ\bbc.exe
How can I perform that ?
MK-Gii 21-Mar-14 8:00am    
Hello Pradeep.
http://stackoverflow.com/questions/3822915/how-do-i-programmatically-change-a-lnk-to-change-its-target
P.S.: please next time read what it sais in the right, when you post a question. Hint: it sais something about using google - would have definitely helped you.
iampradeepsharma 21-Mar-14 23:59pm    
I have a program installed on my machine now what I want is to write a script(batch file ,vb script anything)which can serve the following purpose .
The target path of the shortcut on the desktop shows "
C:\XYZ\abc.exe"
Now I want to change it to C:\XYZ\bbc.exe
How can I perform that ?

1 solution

This[^] should serve your purpose.

However, if you want something more comprehensive and exhaustive then you may want to look at this one[^]

[Please accept/up-vote answers or solutions that work for you to encourage participation]
 
Share this answer
 
Comments
iampradeepsharma 22-Mar-14 1:04am    
It didn't help either .
iampradeepsharma 22-Mar-14 2:24am    
Upon using the script(.wsf)

Set wsc = WScript.CreateObject("WScript.Shell")
Set lnk = wsc.CreateShortcut(wsc.SpecialFolders("desktop") & "\Xyz.LNK")

lnk.targetpath = "C:\\ABC\\bcd.exe"
lnk.save

I got following error:
unterminated entity reference -matching ';'not found

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900