Question windows right click event to run a program

karthiksg

New member
Joined
Dec 27, 2016
Messages
1
Programming Experience
Beginner
Hi There

I am in need a utility that will pass a filename.extension as a parameter to an exe file input.
In brief.

I need to know how to create a c# application to pass input parameters while running the file after the filename.

my filename will be

jack_12122016_1234567890.jpg
jack_12122016_1234567890.txt
jack_12122016_1234567890.doc

when i right click the file my sub menu looks like

jack_12122016_1234567890.jpg
New File
New Folder
Refresh
Send SMS
Sent to
Properties


when i click on the Send SMS sub menu it should read the file name parameters as input and
should send sms to the number mentioned in the filename( the third parameter )
should send the date and name as message content.

i already have the code snippet to run the sendsms program as exe file which has to be given inputbox for name, date (from timestamp) and phonenumber from inputbox

can any one help how to create a c# application to get values in runtime, while executing

sendsms.exe,$name,$date,$phone

thanks in advance
 
You really have two questions going on here:
1) If you create a WinForms app, you can use Environment.GetCommandlineArgs(), which is an array, to know what parameters was passed in at launch. If you're creating a Console app you have Sub Main(Args As String[]) in the declaration, just use your Args array.

2) You want to add an entry to the context menu for file type(s) in in windows explorer, you'll need to edit the registry to add this and here's an article on how to do that: How to Add Any Application Shortcut to Windows Explorer's Context Menu
 
Back
Top Bottom