Re: creating a shortcut?

  • Thread starter Thread starter Dave Patrick
  • Start date Start date
D

Dave Patrick

A couple of ways to do this include using the CreateShortcut method of
VBScript. Or try Marty List's cool tool Shortcut v. 100
http://optimumx.com/download/#Shortcut


This VBScript would create a shortcut to a mapped drive 'S:\'
--------------------------
set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\S Drive.lnk")
oShellLink.TargetPath = "S:\"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "explorer.exe, 1"
oShellLink.Description = "Network S Drive"
oShellLink.WorkingDirectory = "S:\"
oShellLink.Save
Set WshShell = Nothing
Set oShellLink = Nothing
--------------------------
Depending on what you're wanting, use either;

WshShell.SpecialFolders("Desktop")
WshShell.SpecialFolders("AllUsersDesktop")

Also WSH 5.6 documentation download at
http://www.microsoft.com/downloads/...48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en
 
thanks for all the help
-----Original Message-----
A couple of ways to do this include using the CreateShortcut method of
VBScript. Or try Marty List's cool tool Shortcut v. 100
http://optimumx.com/download/#Shortcut


This VBScript would create a shortcut to a mapped drive 'S:\'
--------------------------
set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\S Drive.lnk")
oShellLink.TargetPath = "S:\"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "explorer.exe, 1"
oShellLink.Description = "Network S Drive"
oShellLink.WorkingDirectory = "S:\"
oShellLink.Save
Set WshShell = Nothing
Set oShellLink = Nothing
--------------------------
Depending on what you're wanting, use either;

WshShell.SpecialFolders("Desktop")
WshShell.SpecialFolders("AllUsersDesktop")

Also WSH 5.6 documentation download at
http://www.microsoft.com/downloads/details.aspx? FamilyId=01592C48-207D-4BE1-8A76-
1C4099D7BBB9&displaylang=en


--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft MVP [Windows NT/2000 Operating Systems]

adam said:
i am not very familiar with creating batch files, but i am
trying to create one anyways. and i am have problems
creating a shortcut on the desktop for all users. well
what im trying looks like this:

copy T.exe "c:\documents and settings\all
users\desktop\T.exe"

its copying the file, but not as a shortcut. it no workie!
what do i need to do to make it a shortcut. i know this
simple question for someone. PLEASE HELP!!! thanks to all
that reply.


.
 
Another, less glamourous way, is to create a shortcut to T.exe on one of
your clients, copy it to the server, and then copy *that* file to the
desktop instead of the .exe itself.

/Al

thanks for all the help
-----Original Message-----
A couple of ways to do this include using the CreateShortcut method of
VBScript. Or try Marty List's cool tool Shortcut v. 100
http://optimumx.com/download/#Shortcut


This VBScript would create a shortcut to a mapped drive 'S:\'
--------------------------
set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\S Drive.lnk")
oShellLink.TargetPath = "S:\"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "explorer.exe, 1"
oShellLink.Description = "Network S Drive"
oShellLink.WorkingDirectory = "S:\"
oShellLink.Save
Set WshShell = Nothing
Set oShellLink = Nothing
--------------------------
Depending on what you're wanting, use either;

WshShell.SpecialFolders("Desktop")
WshShell.SpecialFolders("AllUsersDesktop")

Also WSH 5.6 documentation download at
http://www.microsoft.com/downloads/details.aspx? FamilyId=01592C48-207D-4BE1-8A76-
1C4099D7BBB9&displaylang=en


--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft MVP [Windows NT/2000 Operating Systems]

adam said:
i am not very familiar with creating batch files, but i am
trying to create one anyways. and i am have problems
creating a shortcut on the desktop for all users. well
what im trying looks like this:

copy T.exe "c:\documents and settings\all
users\desktop\T.exe"

its copying the file, but not as a shortcut. it no workie!
what do i need to do to make it a shortcut. i know this
simple question for someone. PLEASE HELP!!! thanks to all
that reply.


.
 
Al Dunbar said:
Another, less glamourous way, is to create a shortcut to T.exe on one of
your clients, copy it to the server, and then copy *that* file to the
desktop instead of the .exe itself.

/Al

This will work most of the time, but watch out for distributed link
tracking. The original name of the machine the shortcut was created on is
stored inside the .LNK file, and if the target can't be found on the local
machine it will run from the original machine using \\computer\c$

One way around this is to run a tool like SCUT.EXE to make the shortcut
non-tracking before you start copying it to other machines. SCUT.EXE used
to be available here, but it looks like they lost or gave up their domain:
http://www.coffeecomputing.com/


C:\>Scut.exe /?
SCUT.EXE Version 1.1
Copyright 1997, Coffee Computing Corporation
All Rights Reserved.
This product is freeware

A program to turn Win95/NT shortcut (.lnk) files to
non-tracking shortcuts.

Usage:
SCUT filename [options]

Options:
-help This help message
-s recurse subdirectories
-u Undo (re-enable) the the tracking
-q run in quiet mode (less output to the screen)
 
In said:
Al Dunbar said:
Another, less glamourous way, is to create a shortcut to T.exe on
one of your clients, copy it to the server, and then copy *that*
file to the desktop instead of the .exe itself.

/Al

This will work most of the time, but watch out for distributed
link tracking. The original name of the machine the shortcut was
created on is stored inside the .LNK file, and if the target can't
be found on the local machine it will run from the original
machine using \\computer\c$

One way around this is to run a tool like SCUT.EXE to make the
shortcut non-tracking before you start copying it to other
machines. SCUT.EXE used to be available here, but it looks like
they lost or gave up their domain: http://www.coffeecomputing.com/


C:\>Scut.exe /?
SCUT.EXE Version 1.1
Copyright 1997, Coffee Computing Corporation
All Rights Reserved.
This product is freeware

A program to turn Win95/NT shortcut (.lnk) files to
non-tracking shortcuts.

Usage:
SCUT filename [options]

Options:
-help This help message
-s recurse subdirectories
-u Undo (re-enable) the the tracking
-q run in quiet mode (less output to the screen)

Very usefull for making 'em "dumb". :-)
Jerold has it.
http://www.jsiinc.com
Tip 422 has a link to scut11.zip
(same version)
 
Back
Top