Very strange problem in Command

ADO DOT NET

Centurion
Joined
Dec 20, 2006
Messages
160
Hi,
Using "Command" I can open the file which was drag and dropped into my editor and there is no problem here.
But one strange problem is here:
I have added "Edit" command to the Windows context menu so when user right click on a .html file and select "Edit" he can edit his document using my application. But when my application is opened in this mode, Command won't return the path and name of my file, actually command will return nothing!
What should I do here?
Thanks.
 
Go to the registry or "Folder Options" and see what the actual command is for the "Edit" action. There should be a %1 or "%1" in there. When the user selects "Edit" from the context menu the name of the file that is selected will be substituted for the %1. I'm guessing you'll be better off going with the quotes.
 
Oh yes I see.
Thank you marble_eater, you helped me a lot :)

Just one more thing:

If I open a file using "Edit" command in Windows Context menu, if file is located for example in D:\File.htm, there is no problem, it will open.

But if file is located for example here:

C:\Documents and Settings\User Name\Desktop\File.htm

It won't open! You know the following command:

My.Application.CommandLineArgs.Item(0).ToString()

Will return:

"C:\Documents"

It means it cannot support long names? :confused:
What do you think here?
 
Did you try putting quotes around the %1? File names with spaces in them need to be surrounded with quotes or the command line will think that the spaces are separating different file names.
 
Back
Top