Tom's Hardware > Forum > Windows 2000/NT > Windows 2000/NT General Discussion > Disable file associations depending on number of arguments

Disable file associations depending on number of arguments

Forum Windows 2000/NT : Windows 2000/NT General Discussion - Disable file associations depending on number of arguments

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Archived from groups: microsoft.public.windowsnt.registry (More info?)

 

Hi.

I've created a program similar to Unzip. It takes command line arguments
like this:

unzip file1

I've added this Keys to Registry:

HKEY_CLASSES_ROOT\MY_FILE_TYPE\Shell\MYZIP = "Unzip file"
HKEY_CLASSES_ROOT\MY_FILE_TYPE\Shell\MYZIP\Command =
"[PROGRAM_PATH]\MyUnZip.exe" %1

My problem is: when I select more than one file to unzip, the program fails
(windows open a program for each file). How can I disable this file
associaton when the number of arguments is more than one?. I mean, I want
that "Unzip file" only appear when I right click only one file.


Sorry for my bad english.

Thank you.

Sponsored Links
Register or log in to remove.

Archived from groups: microsoft.public.windowsnt.registry (More info?)

 

"Francisco del Valle" <f_delvalle@terra.es> wrote in
news:e6IwrpgAFHA.2156@TK2MSFTNGP10.phx.gbl:

> Hi.
>
> I've created a program similar to Unzip. It takes command line
> arguments like this:
>
> unzip file1
>
> I've added this Keys to Registry:
>
> HKEY_CLASSES_ROOT\MY_FILE_TYPE\Shell\MYZIP = "Unzip file"
> HKEY_CLASSES_ROOT\MY_FILE_TYPE\Shell\MYZIP\Command =
> "[PROGRAM_PATH]\MyUnZip.exe" %1
>
> My problem is: when I select more than one file to unzip, the program
> fails (windows open a program for each file). How can I disable this
> file associaton when the number of arguments is more than one?. I
> mean, I want that "Unzip file" only appear when I right click only one
> file.
>
>
> Sorry for my bad english.
>
> Thank you.
>
>
>

Windows does not create a command line that has more than one argument
when you do this. It creates a command line for each file that you have
selected. In your case, it will try to run one copy of your program for
each file you have selected.
Perhaps you can change your program so that it can run multiple instances
at the same time. For example, if you were using Winzip, it has an
option to "Reuse WinZip Windows" (which you can turn off) which causes it
to only run one instance at a time.

Reply to Anonymous
Tom's Hardware > Forum > Windows 2000/NT > Windows 2000/NT General Discussion > Disable file associations depending on number of arguments
Go to:

There are 557 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them