Click to See Complete Forum and Search --> : How to send through socket with vbs?


koden
September 26th, 2005, 08:59 PM
I have a .cpp that's listening on a particular socket (port), how do I get vbscript to send output to a socket?

mmetzger
September 26th, 2005, 09:34 PM
I'm not for sure you can, at least by itself. You can try something like ncat / netcat which will let you pass output from the vbscript to the socket. That being said it's not going to be easy to parse and react to the socket responses at least w/ vbscript.

koden
September 26th, 2005, 09:46 PM
I'm not for sure you can, at least by itself. You can try something like ncat / netcat which will let you pass output from the vbscript to the socket. That being said it's not going to be easy to parse and react to the socket responses at least w/ vbscript.

I don't need to parse, all I need is to send strings or char*'s over the socket. Can it be done?

koden
September 26th, 2005, 09:52 PM
I'm not for sure you can, at least by itself. You can try something like ncat / netcat which will let you pass output from the vbscript to the socket. That being said it's not going to be easy to parse and react to the socket responses at least w/ vbscript.

how would I send it to netcat? I need everything to be automated, so currently my C++ calls the vbscript to execute using ShellExecute. Then it listens for incoming on a socket.

thanks!

mmetzger
September 26th, 2005, 10:14 PM
Wait... what are you having vbscript do? It's likely much easier to just write to the socket...

That all said, the hack-ish way to do it is have the vbscript write its output to a file, then cat the file to netcat (which connects to the remote socket.)