Board index » Visual Studio » Net Send and VB6

Net Send and VB6

Visual Studio85
I am trying to send a message over my LAN using Shell and Net Send , but am

I able to send the contents of a variable? or only a text message that I

type in?



I would like to have the program send a diff. message depending on

conditions in the program, is this possible and if so how?



I believe the command



net send /user /text but if I put in a variable name in place of

text I just get the variable name sent out , not the contents



any help appreciated





jjsmd@yahoo.com


-
 

Re:Net Send and VB6

Hi Joe!



You have to concatenate the String type variable with the string to have it

evaluated :



<air code>

'***

Private Sub NetSendMessage(ByRef sServerName As String, ByRef sMessage As

String)

Call Shell("net send " & sServerName & " " & sMessage)

End Sub

'***



String concatenation are made with the ampersand & operator in VB.



--

Best Regards

Yanick Lefebvre

"JOE" <jjsmd@yahoo.com>a écrit dans le message de

Quote
I am trying to send a message over my LAN using Shell and Net Send , but

am

I able to send the contents of a variable? or only a text message that I

type in?



I would like to have the program send a diff. message depending on

conditions in the program, is this possible and if so how?



I believe the command



net send /user /text but if I put in a variable name in place of

text I just get the variable name sent out , not the contents



any help appreciated





jjsmd@yahoo.com





-

Re:Net Send and VB6

JOE wrote:

Quote
I am trying to send a message over my LAN using Shell and Net Send , but am

I able to send the contents of a variable? or only a text message that I

type in?



Adding to Zoury's reply, you can get rid of the Shell cmd too if you

want. Use the Windows API instead.



Sending System Messages using NetMessageBufferSend

vbnet.mvps.org/code/network/netmessagebuffersend.htm">vbnet.mvps.org/code/network/netmessagebuffersend.htm





--

Ken Halter - MS-MVP-VB - www.vbsight.com">www.vbsight.com

Please keep all discussions in the groups..

-

Re:Net Send and VB6

I have made a test VB6 app as folows:



Private Sub Command1_Click()

Dim ip As String

Dim msg As String

ip = "Gateway"

msg = "hey how are you"

Shell ("net send" & ip & " " & msg)

End Sub





The problem is when I run this I see a little dos icon flash by but no

message is received.

On the other hand it works fine from the command line?



Any ideas as to how to get this to work?



Thanks

Joe



"JOE" <jjsmd@yahoo.com>wrote in message

Quote
I am trying to send a message over my LAN using Shell and Net Send , but

am

I able to send the contents of a variable? or only a text message that I

type in?



I would like to have the program send a diff. message depending on

conditions in the program, is this possible and if so how?



I believe the command



net send /user /text but if I put in a variable name in place of

text I just get the variable name sent out , not the contents



any help appreciated





jjsmd@yahoo.com





-

Re:Net Send and VB6

"Joseph Schwartz" <jjsmd@yahoo.com>wrote in message

Quote
I have made a test VB6 app as folows:



go to vbnet.mvps.org/">vbnet.mvps.org/ and search for NetMessageBufferSend



--

Reply to the group so all can participate

VB.Net... just say "No"



-

Re:Net Send and VB6

Bob Butler wrote:

Quote


go to vbnet.mvps.org/">vbnet.mvps.org/ and search for NetMessageBufferSend



Or... just back up a couple messages in this thread <g>I gave him the

link to that article... not interested I guess.





--

Ken Halter - MS-MVP-VB - www.vbsight.com">www.vbsight.com

Please keep all discussions in the groups..

-

Re:Net Send and VB6

"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com>wrote in message

Quote
Bob Butler wrote:

>

>go to vbnet.mvps.org/">vbnet.mvps.org/ and search for NetMessageBufferSend



Or... just back up a couple messages in this thread <g>I gave him the

link to that article... not interested I guess.



Odd... I don't see anything from you; all I see in the thread is what looks

like the OP replying to himself.



-

Re:Net Send and VB6

Ken:



I appreciate the link to netmessagebuffersend, I was only trying to

understand what is going wrong with net send?



Joe

"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com>wrote in message

Quote
Bob Butler wrote:

>

>go to vbnet.mvps.org/">vbnet.mvps.org/ and search for NetMessageBufferSend



Or... just back up a couple messages in this thread <g>I gave him the

link to that article... not interested I guess.





--

Ken Halter - MS-MVP-VB - www.vbsight.com">www.vbsight.com

Please keep all discussions in the groups..





-

Re:Net Send and VB6

Bob Butler wrote:

Quote


Odd... I don't see anything from you; all I see in the thread is what looks

like the OP replying to himself.



Well... I see you're using OE? If so, have you done any "Windows

Updates" lately? The last one trashed my OE installation (really bad

too) so I had to switch to another newsreader (thunderbird)



By "trashed my OE installation", I mean that I'm no longer able to use

it at all. All email I had was wiped out as soon as I clicked on the

folder where it was stored (Inbox/Sent Items/etc). If I rec'vd mail, it

would show up in the inbox as usual but as soon as I clicked on the

Inbox folder, wham. gone. Tried to look at a few sent items.. boom.

entire folder empty. I have (had) filters to move mail to specific

folders (mail recv'd from specific vendors went to specific folders).

Clicked on those folders... boom... all gone :-( fwiw, I wasn't the only

one here (where I work) that was effected. Anyone who used OE was

effected. We figure it has something to do with OE and the way it gets

along with McAfee v4.3.20 (which is old)... anyway, no more OE here at

work for anyone. ARGHHH. fwiw, I still use it at home (at least for now)





--

Ken Halter - MS-MVP-VB - www.vbsight.com">www.vbsight.com

Please keep all discussions in the groups..

-

Re:Net Send and VB6

"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com>wrote in message

<cut>

Quote
We figure it has something to do with OE and the way it gets

along with McAfee v4.3.20 (which is old)...



No problems with any updates but I'm not running McAfee so that may be the

issue. OE can be a bit flaky anyway so it probably just last that thread

somewhere along the line.



-

Re:Net Send and VB6

jschwartzmd wrote:

Quote
Ken:



I appreciate the link to netmessagebuffersend, I was only trying to

understand what is going wrong with net send?



Joe



Have you tried it from a DOS prompt? If it works there and won't work

with the Shell command, the Shell command is probably the problem. If it

doesn't work from the DOS prompt, there are other issues to deal with.



--

Ken Halter - MS-MVP-VB - www.vbsight.com">www.vbsight.com

Please keep all discussions in the groups..

-

Re:Net Send and VB6

Hi Joseph,

If that's the actual code, you need another space as a delimiter.



Shell ("net send" & " " & ip & " " & msg)





--

John

johnf 202 at hotmail dot com





"Joseph Schwartz" <jjsmd@yahoo.com>wrote in message

| I have made a test VB6 app as folows:

|

| Private Sub Command1_Click()

| Dim ip As String

| Dim msg As String

| ip = "Gateway"

| msg = "hey how are you"

| Shell ("net send" & ip & " " & msg)

| End Sub

|

|

| The problem is when I run this I see a little dos icon flash by but no

| message is received.

| On the other hand it works fine from the command line?

|

| Any ideas as to how to get this to work?

|

| Thanks

| Joe

|

| "JOE" <jjsmd@yahoo.com>wrote in message

| news:13affe1d.0405140556.478f4d53@posting.google.com...

|>I am trying to send a message over my LAN using Shell and Net Send , but

| am

|>I able to send the contents of a variable? or only a text message that I

|>type in?

|>

|>I would like to have the program send a diff. message depending on

|>conditions in the program, is this possible and if so how?

|>

|>I believe the command

|>

|>net send /user /text but if I put in a variable name in place of

|>text I just get the variable name sent out , not the contents

|>

|>any help appreciated

|>

|>

|>jjsmd@yahoo.com

|

|





-