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 5998257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:22:48+00:00 2026-05-23T00:22:48+00:00

I am opening cmd.exe from my application and navigating it to a file but

  • 0

I am opening cmd.exe from my application and navigating it to a file but the problem is that if the file path has spaces in it, it won’t go there.

Process.Start("cmd.exe", "/C choice /C Y /N /D Y /T 3 & cd C:\Temp Folder");

Instead for looking of Temp Folder, it will only look for temp I guess.

One way is to wrap the path with ” ” but I can’t do it in a string. (tried ‘ ‘)

Another way is to loop through the path, find spaces and replace them with something, but I don’t know with what.

I could use some help with either of this ways (if you have a better one, that’s great)

  • 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-23T00:22:49+00:00Added an answer on May 23, 2026 at 12:22 am

    The \ in the string needs to be escaped and you need to include folder names with space in double quotes.

    Try

    Process.Start("cmd.exe", @"/C choice /C Y /N /D Y /T 3 & cd C:\""Temp Folder""");
    

    or

    Process.Start("cmd.exe", "/C choice /C Y /N /D Y /T 3 & cd C:\\\"Temp Folder\"");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In opening up the .xap file that is generated as output from a Silverlight
Opening an XML file in Internet explorer gives a security warning. IE has a
When opening a file from your hard drive into your browser, where is the
While opening any MS Access database, a security warning appears saying that the file
[DllImport(kernel32.dll)] private static extern Int32 AllocConsole(); I can open cmd.exe with this command. But
Sorry for opening this topic again, but thinking about this topic itself has started
In my Winform app, I execute a exe file using cmd Process. The exe
I have a c# program through which i am opening cmd window as a
After opening a file created by root in vim , how to change the
I have a batch file that creates a scheduled task using schtasks like this:

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.