Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using the command line in c# apps

Status
Not open for further replies.

jwpward

Programmer
Sep 5, 2003
45
GB
I'm building a c# windows app, and part of the functionality needs to be the ability to copy folders from one directory to another, e.g. xcopy\\aaaa\bbbb\cccc \\dddd\eeee\ffff etc

Is it possible to use cmd line commands such as this as part of a windows app, or is there an easier way of doing it? I've only really done asp.net stuff with it up until now.

Thanks
 
Try looking at the DirectoryInfo and FileInfo classes. These should be able to do what you want.

I'm sure you could shell out to a command window, but it is probably better to do it in the above fashion.
 
Take a look at the File.Move method.

It's also possible to call out to XCopy using the Process.Start method.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Thanks for your help guys. Much appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top