Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

how to call system command in vc++?

i wish to call the netsend command in the program but i dont know how to do it? can you please show me the actually of calling net send command in the way of mfc?
0 Kudos
Message 1 of 6
(3,770 Views)
Take a look at the Win32 CreateProcess, ShellExecute, and ShellExecuteEx functions.

- Elton
0 Kudos
Message 2 of 6
(3,770 Views)
Hi,
I have go through all this three functions but i still cant get what i want. Can you please be more specifily to tell me the actual code? the command i want is sending a 'net send' command in the visual c++?

thanks...
0 Kudos
Message 3 of 6
(3,770 Views)
Try this function: system(...);
0 Kudos
Message 4 of 6
(3,770 Views)
Here's one way you can do it with ShellExecute (replace [user] and
[message] accordingly):

::ShellExecute(NULL, _T("open"), _T("net.exe"), _T("send [user]
[message]"), _T(""), 0);

- Elton
0 Kudos
Message 5 of 6
(3,770 Views)
Thanks for your reply. I 'll try it again....

Thanks a lots...:)
0 Kudos
Message 6 of 6
(3,770 Views)