Computing.Net > Forums > Disk Operating System > Batch file for shortcut on Desktop!

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file for shortcut on Desktop!

Reply to Message Icon

Name: Chris
Date: October 9, 2002 at 19:59:31 Pacific
OS: Win 98/NT/2K/XP
CPU/Ram: 128 & above
Comment:

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!



Sponsored Link
Ads by Google

Response Number 1
Name: Hmmm
Date: October 9, 2002 at 20:08:31 Pacific
Reply:

Look into calmira, it's a windows 95 style shell for win/wfw 3.x. It's at calmira.org.



0

Response Number 2
Name: Chris
Date: October 9, 2002 at 21:07:48 Pacific
Reply:

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!


0

Response Number 3
Name: Hmmm
Date: October 10, 2002 at 01:16:56 Pacific
Reply:

Chris the calmira site seems unavailable at present.

Try here-

http://hammer.prohosting.com/~planetc/planet.htm


0

Response Number 4
Name: Spamtrap
Date: October 10, 2002 at 12:31:58 Pacific
Reply:

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.


0

Response Number 5
Name: Chris
Date: October 10, 2002 at 17:49:28 Pacific
Reply:

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!


0

Related Posts

See More



Response Number 6
Name: - Uziel -
Date: October 12, 2002 at 22:14:26 Pacific
Reply:

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 !


0

Response Number 7
Name: Chris
Date: October 13, 2002 at 00:17:31 Pacific
Reply:

Hi Uzie1,

Can you please send me your code, my email is sthchris@hotmail.com

Thanks!


0

Response Number 8
Name: Chris
Date: October 13, 2002 at 00:19:20 Pacific
Reply:

Hi Uzie1,

Can you please send me your code, my email is sthchris@hotmail.com

Thanks!


0

Response Number 9
Name: - Uziel -
Date: October 13, 2002 at 12:01:17 Pacific
Reply:

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!) ??


0

Response Number 10
Name: Rod
Date: November 14, 2002 at 14:13:00 Pacific
Reply:

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}


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Batch file for shortcut on Desktop!

batch files for link analysis www.computing.net/answers/dos/batch-files-for-link-analysis/14281.html

Can you execute a batch file for a web page www.computing.net/answers/dos/can-you-execute-a-batch-file-for-a-web-page-/5382.html

Pause a batch file for 10 sec' www.computing.net/answers/dos/pause-a-batch-file-for-10-sec/8249.html