Help - Search - Members - Calendar
Full Version: Create shorcut :/
MSFN Forums > Unattended Windows Discussion & Support > Application Installs

   


Google Internet Forums Unattended CD/DVD Guide
martinss
Hello people, i'need create a shorcut in DESKTOP from Windows Live Messenger with BATCH file, the complete route is:
C:\Archivos de programa\Windows Live\Messenger\msnmsgr.exe

how can do?
BigRandalo
try this here:
http://wwwbzs.tu-graz.ac.at/~fleischh/comp...d/software.html (shortcut.exe)

or this: http://www.optimumx.com/download/#Shortcut

hope that helps
ajua
any of those exe files should do the work. saludos!
ckislam
is there a way to create shortcuts without downloading an extra command?
BigRandalo
i searched i while but i didnt find anything
you could use vbs scripts or those exe files
on a win98cd there is a shortcut.exe from ms but i dont have any lying around :x

Edit: just found this here @ msfn http://www.msfn.org/board/index.php?showtopic=20355
and this: http://www.nirsoft.net/utils/nircmd.html
QUOTE
Create a shortcut on your desktop that switch the system volume between the mute and normal state.
nircmd.exe cmdshortcut "~$folder.desktop$" "Switch Volume" mutesysvolume 2
Yzöwl
QUOTE (ckislam @ Jul 5 2007, 11:56 PM) *
is there a way to create shortcuts without downloading an extra command?
You can use an inf file to generate shortcuts.

Attached is a batch file I have compiled and zipped, which will create desktop shortcuts to programs.

The file is simply called using the name of the app as a parameter.

In order to achieve the required result, there are some rules:
  • The parameter must be an 'exe' file.
    e.g. msnmsgr.exe (is allowed); WinRAR.hlp (is not allowed).
  • The file extension, however, must not be input.
    e.g. msnmsgr (works); msnmsgr.exe (does not work)
  • The exe filename must not contain any spaces.
    e.g. msnmsgr (works); NFO Viewer (does not work).
  • The file must reside somewhere within %ProgramFiles%.
Example for the original questioner:
CODE
MDTLink msnmsgr

This file has not been extensively tested, especially on non-English systems.
ckislam
hello,

i dont want want to download a command to generate my shortcuts.
i was asking how to create shortcuts with the usual windows commands from the console.
is it possible ?

thanks
spacesurfer
Go ahead and create your shortcut to your program e.g. "my shortcut". Shortcuts have a hidden extension lnk.

Copy that shortcut to where your script is located.

Then, use

CODE
copy "my shortcut.lnk" "x:\destination"


FYI
In order to create a shortcut, it must point to a valid location. Therefore, you have to create the shortcut beforehand. However, once you create it, it doesn't matter if the location is valid or not. And you can copy it wherever you want and it will still point to the same location.

All shortcuts have the extension .lnk although you can't see it.
Yzöwl
QUOTE (ckislam @ Jul 6 2007, 09:48 PM) *
hello,

i dont want want to download a command to generate my shortcuts.
i was asking how to create shortcuts with the usual windows commands from the console.
is it possible ?

thanks
I have already told you that it is possible using an inf file and you can also use vbscript. In order to satisfy the original posters requirements both of these methods can be implemented, (written and run), from a batch file.

There are very many, (several from myself), posts throughout this forum showing the syntax for this method of shortcut creation. As a proof of concept, I have written a batch file which creates and runs the appropriate file for you.

The file I have written is far too complex for the majority of users and for that reason it's coding has been protected from view by compiling it to an exe. The complexity is due to the way it has to be able to work with a simple input parameter. Unfortunately showing the coding of it will most certainly confuse more people than it will help.

Your file will not need to be complex like mine, if you do not wish to use my file then all you need to do is search the forums for the examples already given, digest the information and implement it yourself.
ricktendo64
INF is the easiest way to do it
[deXter]
QUOTE (ckislam @ Jul 6 2007, 02:48 PM) *
hello,

i dont want want to download a command to generate my shortcuts.
i was asking how to create shortcuts with the usual windows commands from the console.
is it possible ?

thanks


If you really want to do this by typing out commands in the console, then just run these commands one by one:

CODE
echo > s.vbs set Ws = WScript.CreateObject("WScript.Shell")
echo >>s.vbs set Os = Ws.CreateShortcut("%UserProfile%\Desktop\Messenger.lnk")
echo >>s.vbs Os.TargetPath = "%ProgramFiles%\Windows Live\Messenger\Msnmsgr.exe"
echo >>s.vbs Os.WorkingDirectory = "%ProgramFiles%\Windows Live\Messenger"
echo >>s.vbs Os.Save
echo.>>s.vbs
s


I suppose the commands are pretty self-explanatory. The CreateShortcut line is the full path to the shortcut you want to create, TargetPath is the full path of the program, and WorkingDirectory line is required for some programs to launch properly. Windows Live Messenger however doesn't require this line and you can skip it. The shortcut will be created when you type "s" and press enter.
ckislam
@ [Dexter]

Thats Great.. thanks a lot.. exactly what i was looking for. thumbup.gif

do you know how to set the icon of the shortcut?
[deXter]
Yeah.. just add this line before the "echo >>s.vbs Os.Save" line:

CODE
echo >>s.vbs Os.IconLocation = "C:\Path to some icon\someicon.ico"


You can also set the other properties too, like for adding a hotkey, just add a line having Os.Hotkey = "CTRL+SHIFT+M" , and if you want a description add Os.Description = "Lets you have online conversations." smile.gif
ckislam
perfect thanks. rolleyes.gif
Yzöwl
QUOTE (ckislam @ Jul 7 2007, 06:01 PM) *
.. exactly what i was looking for.
When 'looking for' did you think to try:
    either
  • shortcut vbs
    or
  • shortcut inf
in the 'basic' Google site search at the top of each page of the forum?




Google Internet Forums Unattended CD/DVD Guide

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.