DOS Commands
-
Hi, How to execute DOS commands in MFC. I use WinExec() to use COPY commands. It works fine to copy files to local directory/system. But it fails to copy file to another PC in the network. WinExec("cmd /c copy Prints.txt \\avon\Prints",SW_SHOW); \\avon is the network PC with shared folder Prints This commands works filke from DOS prompt but not from MFC..Pls help Ram
-
Hi, How to execute DOS commands in MFC. I use WinExec() to use COPY commands. It works fine to copy files to local directory/system. But it fails to copy file to another PC in the network. WinExec("cmd /c copy Prints.txt \\avon\Prints",SW_SHOW); \\avon is the network PC with shared folder Prints This commands works filke from DOS prompt but not from MFC..Pls help Ram
-
Hi, How to execute DOS commands in MFC. I use WinExec() to use COPY commands. It works fine to copy files to local directory/system. But it fails to copy file to another PC in the network. WinExec("cmd /c copy Prints.txt \\avon\Prints",SW_SHOW); \\avon is the network PC with shared folder Prints This commands works filke from DOS prompt but not from MFC..Pls help Ram
-
Hi, How to execute DOS commands in MFC. I use WinExec() to use COPY commands. It works fine to copy files to local directory/system. But it fails to copy file to another PC in the network. WinExec("cmd /c copy Prints.txt \\avon\Prints",SW_SHOW); \\avon is the network PC with shared folder Prints This commands works filke from DOS prompt but not from MFC..Pls help Ram
-
If the DOS command that you wrote was working,... then you can use something like:
ShellExecute(NULL, "cmd.exe", "/c copy Prints.txt \\avon\Prints");
(WinExec is an old function, and it is possible that it isn't a good interface between your app and DOS)Russell
-
Hi, How to execute DOS commands in MFC. I use WinExec() to use COPY commands. It works fine to copy files to local directory/system. But it fails to copy file to another PC in the network. WinExec("cmd /c copy Prints.txt \\avon\Prints",SW_SHOW); \\avon is the network PC with shared folder Prints This commands works filke from DOS prompt but not from MFC..Pls help Ram
cberam wrote:
How to execute DOS commands in MFC. I use WinExec() to use COPY commands. It works fine to copy files to local directory/system. But it fails to copy file to another PC in the network. WinExec("cmd /c copy Prints.txt \\avon\Prints",SW_SHOW); \\avon is the network PC with shared folder Prints
Have a try with system API
system("copy c:\\test.txt \\\\Test\\mydata");
Knock out 't' from can't, You can if you think you can :cool:
-
Hi, How to execute DOS commands in MFC. I use WinExec() to use COPY commands. It works fine to copy files to local directory/system. But it fails to copy file to another PC in the network. WinExec("cmd /c copy Prints.txt \\avon\Prints",SW_SHOW); \\avon is the network PC with shared folder Prints This commands works filke from DOS prompt but not from MFC..Pls help Ram
Most DOS commands have a Win32 API equivalent (e.g.,
CopyFile()
). Use that instead.
"The largest fire starts but with the smallest spark." - David Crow
-
Hi, How to execute DOS commands in MFC. I use WinExec() to use COPY commands. It works fine to copy files to local directory/system. But it fails to copy file to another PC in the network. WinExec("cmd /c copy Prints.txt \\avon\Prints",SW_SHOW); \\avon is the network PC with shared folder Prints This commands works filke from DOS prompt but not from MFC..Pls help Ram
cberam wrote:
It works fine to copy files to local directory/system. But it fails to copy file to another PC in the network.
What about using Direct CopyFile api!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV