Using "Net send command"

halo there,.....

currently i've been using the winXp "Net Send" command to send the message to other Pc over the local network.
i have incorporate the dos-command into my program. but i discover that there seem no way to let my program get the feedback from the command whether the message have successfully send to the destination.
is there anyway to let the program know that the message have successfully sent or not...

my program looks like this


shell(net send ksboyz halo )

i am using the shell function to run the command line....

from
ksboyz
ksboyzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

J-ManCommented:
If all you want is to know if the message was sent successfully you could change your code to:

shell(net send ksboyz halo > C:\feedback.txt)

Then open and read the C:\feedback.txt file into a string.  It will look like either:
(1) The message was successfully sent to ksboyz.
or
(2) An error occurred while sending a message to ksboyz.

Then check the string for either "successfully" or "error" and you'll know if it worked or not.

Note: A failure to send may take a while to register depending on the timeout value (could be 60 - 90 seconds or more), so you will either have to wait a specified amount of time before checking the feedback.txt file or monitor your shell command to know when it terminates.
0
ksboyzAuthor Commented:
halo..... J-man ....i've tried to run it but it seem doesn't work....though if it's in command-dos prompt mode, by simple typing out the statement...it works...

but unfortunately, i try to write it on the program but it shown all the statement(including >c:\feedback.txt) instead of saving feedback to feedback.txt

i=Shell("net send ksboyz haha > C:\feedback.txt", vbHide)
: (


from
ksboyz
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

J-ManCommented:
Oh yeah, I forgot about that "feature".  ;-)
We should use a batch file instead...  try this:

1) Create a text file called "mysend.bat" (without quotes) in the c:\ folder.  You may want to do this (and step 2) with your program if you intend to distribute it, or install the bat file with your setup program.

2) In the mysend.bat file type in the following text and save the file:

net send %* > c:\feedback.txt

3) Change the VB code to:

Dim myStr as String
myStr = "c:\mysend.bat" & " " & "Computername" & " " & "The message text"
'for your example, you would put in "ksboyz" for "computername", and "halo" for "the message text"
i=Shell(mystr, vbhide)
'wait a few seconds
'check c:\feedback.txt file
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CleanupPingCommented:
ksboyz:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
hongjunCommented:
split b/w J-Man(Accepted) and hongjun
0
J-ManCommented:
I agree with hongjun.
Split the points.
0
CleanupPingCommented:
ksboyz:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
hongjunCommented:
split b/w J-Man(Accepted) and hongjun
0
DanRollinsCommented:
Moderator, my recommended disposition is:

    Split points between: hongjun and J-Man

DanRollins -- EE database cleanup volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.