dynamically changing link / shortcut location?

Posted: 01-19-2009, 04:59 PM
Hello,
Is there a way to dynamically change the location of a shortcut?
Here is my issue:
I have a network folder: \\server\share\test

in the test folder I have Application1.exe and Shortcut to
application1

I copy the test folder from the \\server\share to C:\Program Files

so now I have a C:\Program Files\test folder
the thing is, the shortcut to application1 still point to \\server
\share\test

Is there a way to dynamically change this so when I move it to another
location, the shortcut changes?

so the shortcut should be: C:\Program Files\test

Any ideas? is this possible?
I am copying this folder via a batch script to 50+ computers and this
would make things much easier

thanks.

dynamically changing link / shortcut location?


Responses to "dynamically changing link / shortcut location?"

Tom Lavedas
Guest
Posts: n/a
 
Re: dynamically changing link / shortcut location?
Posted: 01-19-2009, 05:34 PM
On Jan 19, 11:59*am, Paul <paul...@excite.com> wrote:
> Hello,
> Is there a way to dynamically change the location of a shortcut?
> Here is my issue:
> I have a network folder: \\server\share\test
>
> in the test folder I have Application1.exe and Shortcut to
> application1
>
> I copy the test folder from the \\server\share *to C:\Program Files
>
> so now I have a C:\Program Files\test *folder
> the thing is, the shortcut to application1 still point to \\server
> \share\test
>
> Is there a way to dynamically change this so when I move it to another
> location, the shortcut changes?
>
> so the shortcut should be: C:\Program Files\test
>
> Any ideas? is this possible?
> I am copying this folder via a batch script to 50+ computers and this
> would make things much easier
>
> thanks.
The shortcut can easily be modified, or created for that matter, using
the Wscript.Shell CreateShortcut object. Note that the name is
misleading in that it can be used to modify an existing shortcut's
properties as well as creating them in the first place.

For example, from the WSH documentation (slightly modified VBS
version) ...

set WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop &
"\Shortcut Example.lnk")
oShellLink.TargetPath = "C;\targetlocation\application.exe" '
Path ONLY
oShellLink.Arguments = "/switches and parameters"
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.IconLocation = "notepad.exe, 0" ' for example
oShellLink.Description = "Shortcut Example"
oShellLink.WorkingDirectory = strDesktop ' or wherever
oShellLink.Save

See the downloadable WSH documentation (URL all one line):
http://www.microsoft.com/downloads/d...6-1C4099D7BBB9

Tom Lavedas
***********
http://there.is.no.more/tglbatch/
ten.nigriv@virgin.net
Guest
Posts: n/a
 
Re: dynamically changing link / shortcut location?
Posted: 01-19-2009, 06:51 PM
On Mon, 19 Jan 2009 08:59:47 -0800 (PST), Paul wrote:
> Hello,
> Is there a way to dynamically change the location of a shortcut?
> Here is my issue:
> I have a network folder: \\server\share\test
>
> in the test folder I have Application1.exe and Shortcut to
> application1
>
> I copy the test folder from the \\server\share to C:\Program Files
>
> so now I have a C:\Program Files\test folder
> the thing is, the shortcut to application1 still point to \\server
> \share\test
>
> Is there a way to dynamically change this so when I move it to another
> location, the shortcut changes?
>
> so the shortcut should be: C:\Program Files\test
>
> Any ideas? is this possible?
> I am copying this folder via a batch script to 50+ computers and this
> would make things much easier
>
> thanks.
Two things initially spring to mind.
Firstly, why not just create the shortcut to '%ProgramFiles%\test' in the
first place. If you are deploying this to multiple PC's then those PC's
will likely be receiving the copies of 'test' directory in the same
locations!
Secondly, where is the shortcut going?. There is little no point in having
a shortcut located inside a %ProgramFiles% directory if that is also the
location of the target!. Even if the shortcut has additional parameters
required to run the target, which would be the only purpose in them being
in the same location, that location is not easily reachable for your users
to easily invoke it.
A little more information would help.
John Gray
Guest
Posts: n/a
 
Re: dynamically changing link / shortcut location?
Posted: 01-19-2009, 07:31 PM
On 19 Jan, 16:59, Paul <paul...@excite.com> wrote:
> Hello,
> Is there a way to dynamically change the location of a shortcut?
> Here is my issue:
> I have a network folder: \\server\share\test
>
> in the test folder I have Application1.exe and Shortcut to
> application1
>
> I copy the test folder from the \\server\share *to C:\Program Files
>
> so now I have a C:\Program Files\test *folder
> the thing is, the shortcut to application1 still point to \\server
> \share\test
>
> Is there a way to dynamically change this so when I move it to another
> location, the shortcut changes?
>
> so the shortcut should be: C:\Program Files\test
>
> Any ideas? is this possible?
> I am copying this folder via a batch script to 50+ computers and this
> would make things much easier
>
> thanks.
Have a look at Marty List's Shortcut utility
http://optimumx.com/download/#Shortcut
 
LinkBack Thread Tools Display Modes
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamically changing link / shortcut location? Paul Windows XP Help & Support 5 01-19-2009 07:31 PM
Getting Broken Link Location? jscooper22@yahoo.com Mac Applications 0 01-12-2006 07:05 PM
Shortcut Link Jay [Home] Customize Windows XP 1 01-26-2004 05:11 AM
System Folder link instead of shortcut... not always available? ShrimpBoy Customize Windows XP 2 12-26-2003 06:31 PM
Which file specify the location of desktop shortcut JL Windows XP 1 08-04-2003 12:51 AM