Is it possible to run NET SEND command from Windows application?
Actually, command is NET, with syntax:
NET SEND [host_adress|*] 'some_message'
How to forward these Parameters to NET command?
Yes, but using:
ShellExecute(0, 'Open', PChar('c:\Windows\system32\net.exe'), PChar('send 192.168.1.1 messagetext'), PChar(''), SW_Hide);
doesn't produce any effect from my app, and even generates error when run from Delphi!?
I'm not sure is it possible to use ShellExecute for programs that should be run from Command prompt...
Change the 0 to a 1 to hide the console box that flashes up for a moment. The cast to a PChar is in case you want to replace any part of the string with a variable, eg:
@KempCGDR:
Tnx, but... Did you try your suggestion? I try and it doesn't work, nothing happens!?!?
Just an 'command prompt like' windows appears for second, but message isn't send nor any error message appears.
Well, I have to admit that it was adapted from something else I was using, but that was also one of the NET commands, so I don't see why that should work and this not.
The appropriate service is running on your machine, correct?
NET SEND command works fine from Command Prompt.
But, I can't find mathod to run it from my application. I try both of your suggestions (ShellExecute and WinExec) without results. Any advice? Tnx
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.