Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

right click

Status
Not open for further replies.

Matta25

Technical User
Jan 6, 2004
82
US
Hello,
I would like to put my exe in the "Send to" right click menu. I then want to be able to right click on a .zip file and goto "Send to" and then click on the exe and have the proogram unzip the file.
Any ideas on how to pass the filename I click on to the program?
Thanks
 
You can create shortcuts in the Send To folder manually. As for opening zip files in your application, you'd have to accept the filename as a command argument and then write the relevant code to unzip it and do whatever you need to do with the file.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanks,
I have the unzipping code writen already. I not sure how to tell VB.net the filename I right clicked on to feed to the program in the "send to" menu. Any samples of this.
Thanks
 
You can use the following function to get the commandline arguments used for a VB .NET exe:

Code:
Function GetCommandLineArgs() As String()
  ' Declare variables.
  Dim separators As String = " "
  Dim commands As String = Microsoft.VisualBasic.Command()
  Dim args() As String = commands.Split(separators.ToCharArray)
  Return args
End Function

It returns a string array. You can use something like the following line to see what exactly will be returned as an argument:

Code:
MsgBox(GetCommandLineArgs(0))

This will get the first argument. I'm not sure in which format it will be returned, but I'm sure you can deal with it accordingly...

Regards, Ruffnekk
---
Is it my imagination or do buffalo wings taste just like chicken?
 
I've tried the above in a quick sample and the argument is the complete path to the file, so it's very useful for you ;)

Regards, Ruffnekk
---
Is it my imagination or do buffalo wings taste just like chicken?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top