-
Nov 19th, 2016, 10:09 AM
#1
Thread Starter
New Member
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
-
Nov 19th, 2016, 07:19 PM
#2
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.
-
Nov 19th, 2016, 07:31 PM
#3
Thread Starter
New Member
Re: How to use selected location in process(cmd.exe) argument ?
-
Nov 19th, 2016, 08:12 PM
#4
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.
-
Nov 19th, 2016, 11:57 PM
#5
Thread Starter
New Member
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
-
Nov 20th, 2016, 01:29 AM
#6
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|