0

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.

6
Contributors
9
Replies
15
Views
8 Years
Discussion Span
Last Post by mirza.imran
0
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.

0

probably doing an assignment for school and is directed to do it this way. (maybe a vbscript batch file for system admin?)

0

hello friends

Shell("cmd /c copy file1 file2", vbHide)

doesn't work.
I need to run the command

copy /b file1 + file2

how can I do this?

0

It doesn't works.Any way thanks for your reply.As I mentioned above I want to perform

copy /b file1 + file2 file3
0

Are File1 File2 and File3 supposed to be variables in your program, or are they hard-coded in names?

0

To run DOS command in VB.Net use following code. It might be useful for you.
Shell("cmd.exe /c c:\first.exe < in.txt > out.txt")

<<snip>>

Edited by Nick Evan: Spam removed

0

Dim tre = "copy /b """ & txtFile1.Text & """" & txtFile2.Text & """
Shell(tre, vbHide)

bt if you want two files to be copied into one ?? you shuld look for the particualr command to that bt the syntax to call it in the vb.net code will be the same.

>

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.