PC Review


Reply
Thread Tools Rate Thread

Disable file associations depending on number of arguments

 
 
Francisco del Valle
Guest
Posts: n/a
 
      24th Jan 2005
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.



 
Reply With Quote
 
 
 
 
Mark V
Guest
Posts: n/a
 
      24th Jan 2005
In microsoft.public.win2000.registry Francisco del Valle wrote:

> 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.


Generally your application should parse passed arguments and if
designed to do so, utilize only the first one.

...\myzip.exe "%*"
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable conversion from text to number from .csv file Steve Forest Microsoft Excel Misc 2 7th Jul 2008 08:28 PM
Batch file fails strangely checking number of arguments David Mayerovitch Windows XP Help 2 18th Nov 2006 11:15 AM
Copy a number from one cell to another depending on first number =?Utf-8?B?bWFyY2lhIGRyaXNjb2xs?= Microsoft Excel Worksheet Functions 3 3rd May 2005 08:30 PM
Command-line arguments, file associations =?Utf-8?B?U2hlbHRvbg==?= Microsoft Dot NET Framework Forms 0 27th Apr 2005 05:14 AM
Disable file associations depending on number of arguments Francisco del Valle Microsoft Windows 2000 Registry 1 24th Jan 2005 01:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:57 AM.