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

  • Home
  • SEARCH
  • 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 4624212
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:05:54+00:00 2026-05-22T03:05:54+00:00

I am developing a windows application, I need to get the Folder name while

  • 0

I am developing a windows application, I need to get the Folder name while right clicking on the Folder to do some operations on it .

So far I did the following :

  1. Made a registry subkey in HKKEY_CLASS_ROOT\Folder\shell\(my program name)
  2. Made a registry subkey of my program name\command [the path of my program]

now I made the registry key to be displayed in folder context menu. And in my application I did the following :

1- in program.cs

    static void Main(string[] args)
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Form1 p = new Form1();
        if (args.Length > 0)
        {
            p.pathkey = args[0];
        }
        Application.Run(p);
    }

2- in my form1 :

    private string _pathkey;
    public string pathkey
    {
        get { return _pathkey; }
        set { _pathkey = value; }
    }

    private void Form1_Load(object sender, EventArgs e)
    { 
        if (this.pathkey != null)
        {
           textBox1.Text=pathkey;
        }
    }

finally :

now when I right click on a folder lets say for example called NEW. then textbox3.text = C:\NEW , so far it works fine but if the folder name is New Folder then textbox3.text = C:\New only not C:\New Folder and that is my problem if args.length > 0 it does only display the the lenght 0 not the full path.

  • 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-22T03:05:55+00:00Added an answer on May 22, 2026 at 3:05 am

    You need to put the %0 in the registry in quotes to force the entire path to be treated as a single argument.
    Otherwise, the spaces are treated as argument separators.

    You could also call String.Join(" ", args) to manually recombine all of the arguments, but the first way is better.

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

Sidebar

Related Questions

I'm working with C#.net developing applications for windows mobile 6, and i need get
I am developing a Windows .NET application (WinForms) and I need to simulate a
I'm developing a small tray-icon application for Windows and I need to display non-intrusive
I'm developing a web application and I need to mix Forms & Windows authentication
I am developing LOB application, where I will need multiple dialog windows (and displaying
I am developing a windows application and using Postgres as backend database. At some
I'm developing a twitter application for Windows Phone 7 and have been doing some
I'm developing a .NET WINDOWS FORM Application , I need to develop a search
I'm developing a Windows application in VS2005 using C#. In my project, I generate
I am developing a windows application with a WebBrowser control that navigates to a

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.