How to use DOS command in vb.net

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2008
Posts: 11
Reputation: krm08 is an unknown quantity at this point 
Solved Threads: 0
krm08 krm08 is offline Offline
Newbie Poster

How to use DOS command in vb.net

 
0
  #1
Jan 20th, 2009
Hello Everybody,
I want to I want to perform dos command (copy) in vb.net.I want to do it on button click event.Invoking the command using .bat format is not suit for me, because the source and destination of copying depending upon the selection of source and destination(that's done by users of this application).Please help me.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1
Reputation: bobbydiaz is an unknown quantity at this point 
Solved Threads: 0
bobbydiaz bobbydiaz is offline Offline
Newbie Poster

Re: How to use DOS command in vb.net

 
0
  #2
Jan 20th, 2009
  1. Shell("cmd /c copy file1 file2", vbHide)

the cmd /c closes the command window as soon as the command is ran and vbhide hides the command window so its not seen.

Hope this helps.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: How to use DOS command in vb.net

 
0
  #3
Jan 20th, 2009
Dunno why you don't just do the copy from within VB.NET (without a system call)
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 276
Reputation: rapture has a spectacular aura about rapture has a spectacular aura about 
Solved Threads: 37
rapture rapture is offline Offline
Posting Whiz in Training

Re: How to use DOS command in vb.net

 
0
  #4
Jan 20th, 2009
probably doing an assignment for school and is directed to do it this way. (maybe a vbscript batch file for system admin?)
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 11
Reputation: krm08 is an unknown quantity at this point 
Solved Threads: 0
krm08 krm08 is offline Offline
Newbie Poster

Re: How to use DOS command in vb.net

 
0
  #5
Jan 20th, 2009
hello friends
  1. Shell("cmd /c copy file1 file2", vbHide)
doesn't work.
I need to run the command
  1. copy /b file1 + file2
how can I do this?
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 276
Reputation: rapture has a spectacular aura about rapture has a spectacular aura about 
Solved Threads: 37
rapture rapture is offline Offline
Posting Whiz in Training

Re: How to use DOS command in vb.net

 
0
  #6
Jan 20th, 2009
File.Copy("C:\directory\File1.txt", "C:\Directory\File2.txt")
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 11
Reputation: krm08 is an unknown quantity at this point 
Solved Threads: 0
krm08 krm08 is offline Offline
Newbie Poster

Re: How to use DOS command in vb.net

 
0
  #7
Jan 21st, 2009
It doesn't works.Any way thanks for your reply.As I mentioned above I want to perform
  1. copy /b file1 + file2 file3
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: How to use DOS command in vb.net

 
0
  #8
Jan 21st, 2009
Are File1 File2 and File3 supposed to be variables in your program, or are they hard-coded in names?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC