../Basics/Shortcutting syntaxHome
Shortcutting syntax
Some shortcuts you might want on your desktop or anywhere else. For all these, choose create new shortcut and enter the command line:
Shutdown commands
Enter this command line:
rundll32 user.exe,exitwindows
..to exit Windows easily,

rundll32 user.exe,ExitWindowsExec
..to restart Windows,

rundll32 shell32.dll,SHExitWindowsEx 2
..to reboot the computer, and..

rundll32 shell32.dll,SHExitWindowsEx
..to log off the current user (without the confirmation question).
Those are for 9x (95, 98, Me). XP has shutdown.exe, also available in NT and 2k resource kits:
%windir%\system32\shutdown.exe -r
would be a reboot. Some useful attributes:
-r = shuts down and restarts;
-f = forces processes to terminate;
-l = shuts down all running processes, then logs off;
-s = shuts down to a point at which it is safe to turn off power;
-h = help.

Also note the "-t xx" attribute (thanks Clockwise). Default shutdown has a countdown of 30 seconds, with this you can change that ("-t 00" being zero).
Undefined adds that XP also has "tsshutdn 0 /POWERDOWN" to put in target field for a shutdown and mentioned kill.exe. This tool is provided with 2k (tools dir on the cd), and "will kill every task running without warning, so it probably harms your system in some way or another. Don't do it unless you absolutely have to." Freely available online.
Then, bittemei noted a little application for all platforms, giving room for a lot of specific wishes you might want: "Poweroff is a small program for Win95/98/NT/W2K/XP to schedule a shutdown/reboot/logoff/poweroff/Standby/Hibernate/Lock/Wake-On-LAN at a certain time. It also supports command line options that allow poweroff to be used in batch scripts. It has a built-in scheduler, it allows you to run a program before doing the action, you can give a warning message to the user, wait for a process to finish before doing the action and full remote control is supported."
Short names: enhanced run box
Maybe you noticed, some apps get launched in the run box just by typing their names (for example iexplore.exe for IE, notepad.exe...). That's because when they were installed a reg key with this short name was created in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\.

To create a new short name, create a new key with any name (file name: no special characters), and don't forget the extension (even if you don't need to type it when launching), put ".exe" if you don't know what else to put.
Modify its default value with the real app path.

And best of all, you can use a shortcut as the path ! This means you can make special shortcuts as described below and link to them. For example typing "mycomp" would really open this special folder.
Zeratul adds an even easier way. Any shortcut you drop in your windows folder, renamed to something rememberable, can just be typed in the run box too. And ofcourse that gets even easier with the address bar added to the taskbar (rightclick taskbar, toolbars).
Command creator (shareware (once free), all Windows versions) will make all that easier by modifying the registry for you with a cool interface.
But here's Short Run, great little tool to add any command for free. Those using their run box often should check it out!
Another way proposed by madpigeon, is to modify
"In there, there are string values which allow you to assign a certain character to represent a prefix. So, being an ex-Litestep user, I decided to try setting "!" to a prefix, and it works.

Make shortcuts to all your favorite programs and place them in a folder of your choice. In following with my example, start all the shortcut names with "!". So, "eudora" would become "!eudora". Or, you can choose to use something else besides "!"; it's your choice.

Then, go to the aforementioned key in the registry and add a new string value. The Value Name should be "!", or whatever you have decided to use in front of your file names. The Value Data should be the directory your shortcuts are in, such as "C:\shortcuts\".
So, as an example, if I have a shortcut called "!eudora" in the folder "C:\shortcuts", I would go add a string value with name "!eudora" and data "C:\shortcuts\". Then, if I type "!eudora" in the Address bar, the !eudora shortcut will open (opening the program)."
Full replacements of the run box are here...
Control panel items
If you need a shortcut to some specific tab of any control panel item, the shortcut should go to C:\Windows\Control.exe, or just enter "control" (space), then the name of the .cpl file (comma), name of the control panel item (in your language version, comma), number of the tab you want (front one = 0). For instance, for the listing of your hardware, try this:
control Sysdm.cpl,System,1
Also, there's a couple of items controlled by just one .cpl, main.cpl. For these, make it say:

control main.cpl @X

Replace the @X with:
  • @0 for the mouse properties item;
  • @1 for the keyboard properties item;
  • @2 for the printers item;
  • @3 for the fonts item.
Special folders/items
Some specific Windows folders/items have their own ID within the registry, called a CLSID value (Class Identifier). Making a shortcut to explorer.exe and referring to this value can be a useful way to create some shortcuts.

Command line should look like this:

explorer /root,,::{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

Running IE5 you probably have to leave "/root," out to get them going. Or add "/e," instead to have the item opened in explorer, instead of a seperate window. Here's the clsid values:
My Computer: {20D04FE0-3AEA-1069-A2D8-08002B30309D}
Recycle Bin: {645FF040-5081-101B-9F08-00AA002F954E}
Desktop: {00021400-0000-0000-C000-000000000046}
Control Panel: {21EC2020-3AEA-1069-A2DD-08002B30309D}
Printers: {2227A280-3AEA-1069-A2DE-08002B30309D}
Dial-up networking: {A4D92740-67CD-11CF-96F2-00AA00A11DD9}
Fonts: {BD84B380-8CA2-1069-AB1D-08000948F534}
Internet Explorer: {871C5380-42A0-1069-A2EA-08002B30309D}
Microsoft Outlook: {00020D75-0000-0000-C000-000000000046}
Network Neighborhood: {208D2C60-3AEA-1069-A2D7-08002B30309D}
Inbox: {00020D76-0000-0000-C000-000000000046}
Subscriptions: {F5175861-2688-11d0-9C5E-00AA00A45957}
URL History Folder: {FF393560-C2A7-11CF-BFF4-444553540000}
Briefcase: {85BBD920-42A0-1069-A2E4-08002B30309D}
Internet Cache Folder: {7BD29E00-76C1-11CF-9DD0-00A0C9034933}
ActiveX Cache Folder: {88C6C381-2E85-11D0-94DE-444553540000}
One oddity, for the control panel it should read:

explorer /root,,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}

Note some of these might get inverted in different windows versions, so if one doesn't work try something else.
Handling alternative launchers
If you use one of the utilities to create bitmapped links on the desktop and/or one of the additional toolbars, you may find it's only possible to link executables. But it's often possible to link to folders and files too by entering your own command line (if the app itself won't let you, there's often an .ini or other file that can be edited in notepad, and it will work.

Basically, you still enter an executable, the one you want the folder/file to be opened with. For a folder, that's explorer.exe. Set the action to "c:\windows\explorer.exe, space, path to any folder" to create a shortcut to the folder. Same for specific files, for instance, set it to (..) "c:\program files\Internet Explorer\Iexplore.exe, space, path to .html" if you want a shortcut to some local webfiles.
Some specific links
The "Find: files and folders" dialog is a useful thing to link. A couple of options:

1. Using a command line like "rundll32 shell32.dll,SHFindFiles". I still don't understand why this doesn't work, it should... be nice and rightclick your desktop, choose new/shortcut and enter this line. Does it work for somebody, or got an idea on an alternative ?

2. Using a script (came up in a discussion at Skinz.org, found here). Create a new textfile and enter these lines:
Dim objShell
Set objShell = CreateObject("Shell.Application")
Save and rename the file to find.vbs. Now simply link to the file with the applauncher or a regular shortcut. If you can't link to specific files, try this command line: "wscript.exe x:\path\find.vbs".

3. An option that will work for sure is using an executable that launches the dialog. Dan 'FnaD' Findley coded one that does it (just that, nothing more, coded to answer this question). Find "FaF" here.

4. Another option would be to link to another application, that replaces the dialog. Find some options here, from simple to advanced.

5. Henk van Zetten pointed out one we missed. If you open the dialog, set the direction you commonly search, then choose file/save, you'll have a .fnd file. Clicking/linking the file will open the dialog, set to the directory you choose.

Using the same syntax as the find.vbs file above you could link to some other hidden ui functions, just replace the .FindFiles at the end by any of these :
Cascades all of the windows on the desktop.
Opens a control panel item, replace applet by the file name (*.cpl).
Explores a folder.
Displays the Run dialog.
Displays the Find: Computer dialog box.
Displays the Find: Files dialog box.
Displays Windows Help.
Minimizes all of the windows on the desktop.
Restores all of the windows.
Displays the Date/Time Properties dialog box.
Displays the Shut Down Windows dialog box.
Suspends the computer.
Tiles all of the windows on the desktop horizontally.
Tiles all of the windows on the desktop vertically.
Displays the Taskbar Properties dialog box.
A link to your "current screensaver" could be nice. Ofcourse it's easy to link to any .scr file and have that specific screensaver running. When doing this from an applauncher, add "/s" to the command line if the link opens the configuration dialog of the screensaver. But maybe you're changing screensavers quite often and want the link to go to whatever screensaver you've got installed, without changing the link (?). It seems there's no easy command line to enter for a shortcut (it being not just one call to some system file). So, another simple executable that checks the screensaver you have set and starts it (and nothing more) would be in place:
  • Find "Start Screen Saver" at crayzee's homepage.
  • Another option, if you've got Office installed, is making a shortcut to "officepath\office\osa.exe -s". For Office 2000 it's osa9.exe (thanks Joseph).
  • Or there's QTraySaver.
Just to be complete, if you follow the traditional routes to the "System Configuration tool" (that's opening systeminfo , clicking the "extra" tab, then selecting it, or using the command line and entering "msconfig" - not available in 2k) and want it available otherwise, it's good to know there's an executable in your windows/winnt folder, msconfig.exe, you can link.

And True Small tools (thanks Red) are tiny executables to open your regular close/confirmation, your run dialog and pressing of the startbutton.

The "Folder options" dialog is a useful thing to link. In Me/2k it's an icon in the control panel, so a shortcut can be made. More direct linking is complicated, it seems. Elastic came up with this command line:
rundll32 shell32.dll,Options_RunDLL
This works in Me and XP. For 2k, JP Morgan found
rundll32 shell32.dll,Control_RunDLL appwiz.cpl,@1
Anything to add/ask here ?! This item is nowhere near finished, we'd like to expand it.
Shortcutting apps
An alternative way to "shortcut" your way through the OS would be using SENSIVA Symbol commander (free, pro version available). It lets you draw simple graphic symbols on your screen (holding your right mouse button) that are assigned to actions. Lots of actions are predesigned.
A little less commercial and dug up by Don: "StrokeIt is an advanced mouse gesture recognition engine and command processor. What is a mouse gesture? Mouse gestures are simple symbols that you "draw" on your screen using your mouse. When you perform a mouse gesture that StrokeIt can recognize, it will perform the "action" associated with that gesture." Easy expandable, and free.
[*toptool:] Another cool app would be Winkey (free, all), it lets you assign any keyboard shortcuts (as long as it contains the Winkey) to any app, file or folder, this way you just have to hit some keys and your app is launched, for example pressing Ctrl + Winkey + E would open IE. You can also manage the state of an active window (Close, Minimize...).

More advanced, but with a price, is Hot Keyboard (shareware, all), you can use any key and has some unique options like start screensaver, paste text and you don't have to use the winkey... pointed out by Mike.

Macro Maker (Free, 9x/Nt/2k) is pretty advanced (really, maybe even more than Hot Keyboard), and free. Only drawbacks would be that it leaves an icon in the systray and doesn't support Winkey.

HotKeyz (shareware, all) stands out by having winamp control: it can Play, Stop, Pause, Raise and Lower the volume in Winamp without Winamp being the front application or having any focus. You can also create playlists.

the Wonderful Icon (Free, all) has some unique features (Volume, create new folders...), and can use any key combo you can think of. You can hide the icon too, if you want (check the readme). A little less easy to use than Winkey, but the options are probably worth it, and you don't change your shortcuts every day do you?

WireKeys (Free, 2k+) is pretty nice too, lots of options really.

xhtml 1.1