Results 1 to 6 of 6

Thread: How to use selected location in process(cmd.exe) argument ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2016
    Posts
    3

    Question How to use selected location in process(cmd.exe) argument ?

    How I use FolderBrowserDialog1.SelectedPath in my Process Argument.

    My Code :

    Process.Start("cmd.exe", "/c attrib -h -r -s /s /d FolderBrowserDialog1.Selected Path*.*")

    But Didn't Work !!
    When I Use

    Process.Start(" cmd.exe", "/c attrib -h -r -s /s /d F:\*.*"

    Its work But I want to replace F:\ with user selected location.

    Help
    Last edited by surajking53; Nov 20th, 2016 at 12:19 AM. Reason: Problems Explained

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,301

    Re: How to use selected location in process(cmd.exe) argument ?

    So go ahead and do so. It's just a String like any other. When you call Process.Start, pass the SelectedPath property of the FolderBrowserDialog to the Arguments parameter, just as you would any other String.

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2016
    Posts
    3

    Re: How to use selected location in process(cmd.exe) argument ?

    Can you show Example ?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,301

    Re: How to use selected location in process(cmd.exe) argument ?

    What do you not understand about the examples that you found when you searched online? I'm quite sure that you can find an example of getting the selected path from an OpenFileDialog with very little effort. I'm also sure that you can find an example of passing an argument to Process.Start with very little effort. If you aren't able to work out how take the output from the first and use it as input for the second then you're just not trying very hard.

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2016
    Posts
    3

    Re: How to use selected location in process(cmd.exe) argument ?

    My Code :

    Process.Start("IExplore.exe", "FolderBrowserDialog1.Selected Path")

    But Didn't Work !!
    Help

  6. #6
    Addicted Member NinjaNic's Avatar
    Join Date
    Dec 2013
    Location
    Earth
    Posts
    230

    Re: How to use selected location in process(cmd.exe) argument ?

    Remove the quotes around FolderBrowserDialog1.Selected Path
    (And I think it should just be FolderBrowserDialog1.Path, should it not?)

    Hope it helped!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width