Jump to content

Create shorcut :/


martinss

Recommended Posts


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

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

Edited by BigRandalo
Link to comment
Share on other sites

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:

MDTLink msnmsgr

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

MDTLink.zip

Link to comment
Share on other sites

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

Edited by ckislam
Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:

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.

Edited by [deXter]
Link to comment
Share on other sites

Yeah.. just add this line before the "echo >>s.vbs Os.Save" line:

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." :)

Link to comment
Share on other sites

.. 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?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...