A Conversation for The H2G2 Programmers' Corner

Visual basic and shell

Post 1

Din'Amarth

I am trying to write a crappy little messenger program that uses the "net send" command. As it is every time I send a message it opens a new dos window. Is it possible to do any one of the following things (any would be an acceptable sollution): get the program to use the same dos window for every message, make the dos window close out after the message is sent, or make it so that the thing doesn't even open a dos window.

I'm using Visual Basic 6, and right now I'm using the following bit of code to send the messages.

Shell ("net sent " + compBox.Text + " " + MessageBox.Text)


Visual basic and shell

Post 2

Zak T Duck

Not used VB much but does this help at all?

http://internettrash.com/users/fdb/broadcas.htm


Visual basic and shell

Post 3

Dark Master - The end is now (2005/03/01) Officially Left

calling Shell ("net sent " + compBox.Text + " " + MessageBox.Text) should open a dos dialog then it should close after the program completes. Maybe on win 98 it doesn't close after, it does on XP so I cant really help.


Visual basic and shell

Post 4

Dark Master - The end is now (2005/03/01) Officially Left

If the code above works then its probably the best way to do it.


Visual basic and shell

Post 5

Zak T Duck

Under win98 the net send command doesn't exist, it's only part of NT variant operating systems, and even then only if it's not been disabled.


Visual basic and shell

Post 6

Dark Master - The end is now (2005/03/01) Officially Left

so what are you using then?


Visual basic and shell

Post 7

Zak T Duck

I use XP Pro, but have had experience with Windows since 3.1. Since It's safe to assume that Din'Amarth is using an NT based windows, (NT, 2000, XP and above) since those are the only windows OS that have the net send messenger service.


Visual basic and shell

Post 8

Dark Master - The end is now (2005/03/01) Officially Left

I guessed that much, but i was hoping that when he comes back he might tell us, if he is using xp (home or pro) then it should end the dos window for him, but i dont know about 2000 or NT


Visual basic and shell

Post 9

Din'Amarth

Well, I'm programming the thing on 98, but I'm programming it for a computer with XP.

If XP does indeed close the dos windows then I will just go with what I've got.

I'll try to get the thing tested on XP Tomorrow. If it works, then yay! If not, then I will just have to cry.

~~Din'


Visual basic and shell

Post 10

Dark Master - The end is now (2005/03/01) Officially Left

If your programming it on 98 then how do you even have the net send command, croz is right, my 98 machine doesn't have net send


Visual basic and shell

Post 11

Din'Amarth

No, I don't have net send, but I can tell by the error message that it pops out in the dos window that it would work if I did.

~~Din'


Visual basic and shell

Post 12

DoctorMO (Keeper of the Computer, Guru, Community Artist)

I'd have a look further, I remeber doing some pkzip program and I did manage to get no dos windows to apear at all.

not only that but for compatability I'd use ComIO ActiveX control and do a client service, just because I consider Netsend to be the work of the devil smiley - winkeye

-- DoctorMO --


Visual basic and shell

Post 13

Din'Amarth

I might try something like that later, but for now net send suits my purposes fine. Right now I'm just trying to make a GUIed version a 13 line program I write in QBASIC.

Net send is quick and easy to use, and I don't really need anything more powerful than it.

Also, I have limited programing experiance, and don't really have time to learn how to do ComIO ActiveX control right now. But if you could give me a good web site to read up on that stuff I will look into it.

~~Din'


Visual basic and shell

Post 14

DoctorMO (Keeper of the Computer, Guru, Community Artist)

VB - http://www.vbcode.com/


Key: Complain about this post