Click to See Complete Forum and Search --> : Shell command syntax


thetank
March 28th, 2001, 11:40 PM
I am having trouble with some VB syntax. I would like to pass a variable to the Shell command for NET SEND as follows:

Shell ("NET SEND" & VARIABLE1 & VARIABLE2)

I have tried a few variations of quotation mark placement with no luck. Is this possible to achieve in this case?

Cakkie
March 29th, 2001, 02:36 AM
Make sure there are spaces between the variables, my guess is that you are trying to send a message, so try it like this

Shell "NET SEND " & VARIABLE1 & " " & VARIABLE2




Also make sure that you catch the returnvalue of the shell command. If you do not need the value, you can omit the brackets, or you can use the call statement.

Another thing to know is that the NET SEND command is available only on NT machines (NT of 2000) and will fail if runned on a 95/98

Tom Cannaerts
http://slisse@planetinternet.be

The best way to escape a problem, is to solve it.