Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6831713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:46:11+00:00 2026-05-26T22:46:11+00:00

so I made a program that creates a registry key on the pc, that

  • 0

so I made a program that creates a registry key on the pc, that adds an option to push your file to your device. (The program itself pushes files to your Android sd card.)

Everything works well, or at least should, once I figure out this issue. When I right-click on an item and choose my command (which is to open up with my program) my program just opens up, but no arguments are passed.

A month ago, I designed a program that opens when the user double clicks (just double click, not right-clicking through context menu) a file, it opened the specific program, and from there I was able to grab the arguments.

Why can’t I from the context menu?

Thanks, sorry for lengthy post.

And here’s part of my code:

private void Form1_Load(object sender, EventArgs e)
    {
        string c = textBox3.Text;

          string[] args = System.Environment.GetCommandLineArgs();

          try
          {

              string location = args[1];
              MessageBox.Show(location);
              //For testing purposes only

              Properties.Settings.Default.thinglocation = location;
              Properties.Settings.Default.Save();
              Process();
          }

          catch
          {

          }

Here’s the registry code. BTw string c is “C:\File push.exe” the location of my program.

 string MenuName = "*\\shell\\NewMenuOption";
                string Command = "*\\shell\\NewMenuOption\\command";

                RegistryKey regmenu = null;
                RegistryKey regcmd = null;
                try
                {
                    regmenu = Registry.ClassesRoot.CreateSubKey(MenuName);
                    if (regmenu != null)
                        regmenu.SetValue("", "Push to Android");
                    regcmd = Registry.ClassesRoot.CreateSubKey(Command);
                    if (regcmd != null)
                        regcmd.SetValue("", c +"%1");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(this, ex.ToString());
                }
                finally
                {
                    if (regmenu != null)
                        regmenu.Close();
                    if (regcmd != null)
                        regcmd.Close();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:46:12+00:00Added an answer on May 26, 2026 at 10:46 pm

    I assume that you have created a registry entry which creates the context menu item which you are using to launch your program. Likelihood is that you need to add ‘ %1’ after the name of the exe you want to launch. In the context menu registry entries %1 represents the selected file, so adding this should launch your program and provide the name of the selected file as the single argument.

    the reason why it worked before with the double click is that windows will launch the default program for the file double clicked, with the double clicked file as the argument.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have made a program that reads a text file containing words and
I made a program that opens an application, sleeps the thread for 500ms then
is it possible to install program that i made in VS2008 (FW3.5) on computer
For an assignment I've made a simple C++ program that uses a superclass (Student)
I have a pointer of a structure type that I made. On program start
I made a program. I also made my own file type, which the program
Here's a short program that creates a SQLite database to hold some basic music
I've made a program for my OOP class that does the following: Defines a
The program I've written creates a deck of card that can be shuffled and
I have found a program that can make you save space by hardlinking files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.