Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows XP or 2000 Pro Shortcut Parms

Status
Not open for further replies.

gaus

Programmer
Feb 5, 2001
92
US
Hi,
Does anybody know a way to pass a parm to a shortcut via the properties window or some other method, so when you click on it it mimicks keystrokes or some ascii character or a string?
Thanks,
Gary
 
Generally, you can add parameters at the end of the 'target' field in the properties of the shortcut just as if you typed it from the command prompt. Is this what you're after?
 
It is indeed. I'm sure it's simple, but I have had no reason to do it before. Any examples?
Thanks again!
 
Create a shorcut with the text below as the target:

C:\WINDOWS\system32\shutdown.exe -r -t 10

Make sure any important windows are closed before you run it - it will reboot your computer. The program is shutdown.exe, the -r switch is to reboot, the -t switch is for the time.

You could create a shortcut, use explorer to browse to the .exe that you want to use and finish. Then modify the properties of the shortcut to include the appropriate switches.
 
I meant to add:

Open a command prompt and type:

shutdown /?

for additional switches for my example and give them a try.
 
This is a total guess:

Shortcut parameters work just as they would from inside a batch file.

You can in fact rename myshortcut.lnk myshortcut.cmd and it would work.

So you have only one layer of macro expansion at work on the shortcut line; e.g. %1 and not %%1

You can use:

. Static variables, as smah showed above
. Environmental variables that have been set; e.g. %user%
. You could modify Folder properties to change the Shell commands used to point at your executable if your application uses unique file extensions. e.g. then you could double click the unique filetype and XP could execute "c:\program files\My App\MyApp.exe" %1 and it could substitute for %1.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top