Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi All,
I have a question:
I would like to create a batch file which allow me to create/paste a program's shortcut on the pc's desktop.For example:
I have a Maths.exe program on C Drive's Software folder (C:\Software\Maths.exe), and I would like have a shortcut for this Maths.exe program on my desktop.
(I would like to have a batch file which can do this automatically)What commands should I include in my batch file to do the above task?
Please assist, anyone. Thanks!

Hi Hmmm,
Can you please assist me the full address of the website you mentioned? Did you mean "www.calmira.org"? I tried that, but it didnt link me to any related website!
Thanks!

Chris the calmira site seems unavailable at present.
Try here-
http://hammer.prohosting.com/~planetc/planet.htm

Doesn't windows98 have this ability (but not in batch form ) already via the send to folder ?
Mine does and I dont think I added it.
Right click on the file you want short cutted,
then the 'send to' option, and there should be an option 'Desktop (shortcut)'. That's it.
I think this does what you want.

Hi Spamtrap,
I knew that function in Windows OS, but i need a batch file which can do the task i mentioned for me.
Anyway thanks Spamtrap!
Please assist anyone!

Hello Chris, I was wondering the same.
I try to write a batch that will do the job :-)
However I think the script will only work in
Win98[SE] & WinME. I need to know if the
info in U'r 1st post is exactly, because part's
of the code is CASE SENSITIVE: that means..
"mAtHS.exe" is very different to "Maths.exe"!
If the "case" is not exact: the script FAILES !!Could U please verify "case"? Thanx in advance.
PS: I won't post'e code here, cause it's 4 kb large !

Hello again Chris, U could use this here .VBS-part
-that does the job, I understand U wanted to create
it from a BATCH and thats what I'm working on, but
U should know theres no command to create shortcut
from batch (I think!), so I will "merge" the .VBS-code
into a batch-script (that is the one with a 3-4 kb size!).
Else it would be some all to advanced Registry-"tweaking"
to create a shortcut, so it is better to use the .VBS-script !U may use the below .vbs as "standalone", it works :-)
Caution: it is "CASE sensitive" and also will overwrite
existing shortcut with same name without any prompt!Below must be 18 lines, don't wrapp'em. The red is what to change
if U like to place a shortcut on deskt. to else progr. than "Maths" ! !========START===MkShCut.vbs========
Dim WSHShell
Set WSHShell = _
WScript.CreateObject("WScript.Shell")
Dim MyShortcut, MyDesktop, DesktopPath
DesktopPath = WSHShell.SpecialFolders("Desktop")
Set MyShortcut = _
WSHShell.CreateShortcut(DesktopPath & _
"\- Maths -.lnk")
MyShortcut.TargetPath = _
WSHShell.ExpandEnvironmentStrings _
("C:\Software\Maths.exe")
MyShortcut.WorkingDirectory = _
WSHShell.ExpandEnvironmentStrings("C:\Software")
MyShortcut.WindowStyle = 4
MyShortcut.IconLocation = _
WSHShell.ExpandEnvironmentStrings _
("C:\Software\Maths.exe, 0")
MyShortcut.Save
=========END====MkShCut.vbs========
_________________________________________________________________
PS: I guess this must be a known code for programmers!I'l keep in touch, and mail You the final batch-code later.
By the way: are U batch-script learner (newbie) like Me?___Any comments about the code? (from programmers!) ??

You need a copy of mkln.exe. It is freeware and is a command-line program to create a short-cut (LNK) file.
{http://www.loa.espci.fr/winnt/mkln/mkln.htm}

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |