dynamically changing link / shortcut location?

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

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.
 
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/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9

Tom Lavedas
***********
http://there.is.no.more/tglbatch/
 
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.
 
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
 
Back
Top