PDA

View Full Version : Shortcut switches don't work with File Extension



Wilbur
04-02-2004, 04:25 AM
I have created a File Extension in InstallShield Express 4.01 which successfully enables a file-path to be passed to my application (in VB.NET) at startup - when using either a shortcut or a double-click on an associated file. But when I add switches to the shortcut command line, my application never receives these switches, only the file-path. I do not want to hard-code the switches in the File Extension's 'Arguments' because then the switches would always be passed to my application. So I just need to know how to enable the shortcut command line switches to be passed to the application (along with the file-path).

My program does receive the switches when I bypass using the File Extension/Association. i.e. A shortcut with a full command line - including my executable, the file to open, and 2 switches (/t /debug). Obviously though, for release, I need to remove the executable from the command line.

Your help is much appreciated.

Extra info:
I have tried the following different File Extension 'Arguments', but none have worked:
%1
"%1"
%1 %2 %3
"%1 %2 %3"

Wilbur
04-02-2004, 07:55 PM
Now that I've had a break and a sleep I've just remembered that command line switches never-ever work in any shortcuts that use a file association to open a document. How silly of me!!! This can be proved with Word document shortcuts by adding the /n to the cmd line which is meant to cause a new instance to be opened and not show any already open docs in the Window menu. It doesn't work until the Word executable path is added into the shortcut.

I've left the post here for the benefit anyone else who has also been staring at the screen too long and has a temporary lapse of common-sense while in the depths of the development phase. :-) By the way a break will do you good!