ADO DOT NET Posted November 28, 2007 Posted November 28, 2007 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. Quote
Leaders snarfblam Posted November 28, 2007 Leaders Posted November 28, 2007 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. Quote [sIGPIC]e[/sIGPIC]
ADO DOT NET Posted November 28, 2007 Author Posted November 28, 2007 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? Quote
Leaders snarfblam Posted November 29, 2007 Leaders Posted November 29, 2007 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. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.