I tried that but it seems to only pass the full path of the executable
itself. What I'm after is the following. A user is in Explorer, they right
click on a file and choose Open With, and choose my app. When my app fires
up I'd like to pass the path of the file they right-clicked into the form.
That GetCommandLineArgs method doesn't seem to pass the right info.
Darren

Signature
Darren Mar-Elia
MS-MVP-Windows Server--Group Policy
Check out http://www.gpoguy.com -- The Windows Group Policy Information Hub:
FAQs, Training Videos, Whitepapers and Utilities for all things Group
Policy-related
And, the Windows Group Policy Guide is out from Microsoft Press!!! Check it
out at http://www.microsoft.com/mspress/books/8763.asp
GPOGUY Blog: http://blogs.dirteam.com/blogs/gpoguy
> http://www.devx.com/vb2themax/Tip/18748
>
[quoted text clipped - 11 lines]
>>
>> Thanks!
Brian P. Hammer - 25 Jul 2006 04:53 GMT
Darren - The below code works every time for me. It returns the full path,
including the file name when a user opens a file with my program. I happen
to have a couple file extensions associated with my app.
FilePath = Microsoft.VisualBasic.Command().ToString
If FilePath = String.Empty Or FilePath = "" Then
'Not Opened From File
blnOpenFromSaved = False
Else
blnOpenFromSaved = True
NewFilePath = Replace(FilePath, """", "")
End If
MsgBox FilePath & VbCrLf & NewFilePath
>I tried that but it seems to only pass the full path of the executable
>itself. What I'm after is the following. A user is in Explorer, they right
[quoted text clipped - 19 lines]
>>>
>>> Thanks!
Darren Mar-Elia (MVP) - 25 Jul 2006 15:21 GMT
Thanks Brian-
Unfortunately, I'm using C# and there doesn't *appear* to be an equivalent
method there. I must be missing it. Can't imagine this would be so hard.
Darren

Signature
Darren Mar-Elia
MS-MVP-Windows Server--Group Policy
Check out http://www.gpoguy.com -- The Windows Group Policy Information Hub:
FAQs, Training Videos, Whitepapers and Utilities for all things Group
Policy-related
And, the Windows Group Policy Guide is out from Microsoft Press!!! Check it
out at http://www.microsoft.com/mspress/books/8763.asp
GPOGUY Blog: http://blogs.dirteam.com/blogs/gpoguy
> Darren - The below code works every time for me. It returns the full
> path, including the file name when a user opens a file with my program. I
[quoted text clipped - 34 lines]
>>>>
>>>> Thanks!
Patrice - 25 Jul 2006 15:54 GMT
Try :
http://msdn2.microsoft.com/en-us/library/system.environment.commandline.aspx
(includes a code sample)
Is this correct ?
If not I believe this could be because the file association must explicitely
specify that the file name should be passed i.e. the open command for your
application should be "c:\path\yourapp.exe" "%1" not just
"c:\path\yourapp.exe".

Signature
Patrice
> Thanks Brian-
> Unfortunately, I'm using C# and there doesn't *appear* to be an equivalent
[quoted text clipped - 41 lines]
>>>>>
>>>>> Thanks!
Darren Mar-Elia (MVP) - 25 Jul 2006 16:14 GMT
Patrice-
I had tried that before and I wasn't getting the results I needed, but I
think I see why now--my mistake because of a debugging problem--it is
working with the GetComandLineArgs method.
Thanks to all who helped.
Darren

Signature
Darren Mar-Elia
MS-MVP-Windows Server--Group Policy
Check out http://www.gpoguy.com -- The Windows Group Policy Information Hub:
FAQs, Training Videos, Whitepapers and Utilities for all things Group
Policy-related
And, the Windows Group Policy Guide is out from Microsoft Press!!! Check it
out at http://www.microsoft.com/mspress/books/8763.asp
GPOGUY Blog: http://blogs.dirteam.com/blogs/gpoguy
> Try :
> http://msdn2.microsoft.com/en-us/library/system.environment.commandline.aspx
[quoted text clipped - 53 lines]
>>>>>>
>>>>>> Thanks!