'"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 'This VBScript file gives you the ability to add a parameter String to on execution 'of any .exe file Or a shortcut to one by right-clicking a file or a shortcut. ' I use it to add a parameter of "settings" to my programs by default but you can use it for anything or nothing. 'The default of "settings" is set up in the first program line after these comments. 'HERE'S WHAT YOU DO ' '1. Save the whole of this file (ADDPARAMS.VBS) into your C:\WINDOWS folder. ' If you are not allowed access to do this, then choose a folder you can access and replace the text "c:\\windows\\" ' in the two lines in the in part 2. which begin with @="WSCRIPT.EXE ... with the appropriate path to the folder ' containing ADDPARAMS.VBS. ' YOU MUST DOUBLE BACKSLASHES between subfolders eg. D:\\MYFILES\\SCRIPTS\\ '2. Copy the following block of lines in Notepad, remove the apostrophes (Comments) but leave the blank lines. ' Save the lot as a file called ADDPARAMS.REG somewhere on your computer 'Windows Registry Editor Version 5.00 '[HKEY_CLASSES_ROOT\exefile\shell] '[HKEY_CLASSES_ROOT\exefile\shell\addparams] '@="Add Parameters" '[HKEY_CLASSES_ROOT\exefile\shell\addparams\command] '@="wscript.exe c:\\windows\\addparams.vbs \"%1\"" '[HKEY_CLASSES_ROOT\lnkfile\shell] '[HKEY_CLASSES_ROOT\lnkfile\shell\addparams] '@="Add Parameters to shortcut" '[HKEY_CLASSES_ROOT\lnkfile\shell\addparams\command] '@="wscript.exe c:\\windows\\addparams.vbs \"%1\"" '3. Double-Click on the file ADDPARAMS.REG ' It makes a few simple Entries in the Registry. ' '4. If You want to DELETE all trace of the above Registry entries, make a file UNINSTADDPARAMS.REG in the same ' way as in part 2. using the following block of instructions and doule-click the file. ' - REMEMBER TO REMOVE THE APOSTROPHES 'Windows Registry Editor Version 5.00 '[-HKEY_CLASSES_ROOT\exefile\shell\addparams] '[-HKEY_CLASSES_ROOT\lnkfile\shell\addparams] 'Any problems? ' Email me at roy[PUT AT SIGN HERE]low.net.au ' Enjoy ' Roy Low cmdstr = "settings" 'the default Set WshShell = WScript.CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") iStatus = 0 If WScript.Arguments.Count > 0 Then set WshShell = WScript.CreateObject("WScript.Shell") fil = WScript.Arguments.Item(0) If Right(fil,3) = "lnk" then set oShortcut = WshShell.CreateShortcut(fil) strTarget = oShortcut.TargetPath Else strTarget = fil End If If fso.FileExists(strTarget) Then iStatus = 1 cmdstr = Trim(LCase(InputBox ("Type the parameter string you wish, [OK] accepts default, [ESC] = none","Confirm parameter String", cmdstr))) WshShell.run Chr(34) & strTarget & Chr(34) & " " & cmdstr End if If iStatus = 0 then Msgbox "Cannot find target for " & fil End If End If '"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 'This script was written by Roy Low (roy[PUT AT SIGN HERE]low.net.au) for anyone to use as they wish. 'It is based on parts of a more comprehensive script "OpenTargetDir.vbs" published by Ramesh Srinivasan 'on http://www.winhelponline.com 'Visit us at http://www.winhelponline.com/blog '""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""