| Author |
Message |
Daftlad
Stray Dog

Joined: 14 Oct 2003 Posts: 7
Location: England
|
Posted:
Thu Oct 16, 2003 5:24 am Post subject: Visual Basic 6 question (Using a Dos command) |
|
How would I go about calling the net send command within VB, could someone post an example as to how it is done
thanks buddy's !
lots of love ME lol |
_________________ "Its not the size of the wand, its the magic in the stick.."
|
|
|
|
|
Webster
Guide Dog


Joined: 16 Feb 2002 Age: 28 Posts: 8701
Location: Vacationland
|
Posted:
Thu Oct 16, 2003 5:28 am Post subject: |
|
|
|
|
|
Daftlad
Stray Dog

Joined: 14 Oct 2003 Posts: 7
Location: England
|
Posted:
Thu Oct 16, 2003 5:29 am Post subject: |
|
and me being a complete newbie to VB could you enlighten me to the use of this command. and is there any other methods that I may look into ? |
_________________ "Its not the size of the wand, its the magic in the stick.."
|
|
|
|
|
mellowgreengiant
Toilet Drinker


Joined: 06 Jun 2003 Posts: 330
Location: here
|
Posted:
Thu Oct 16, 2003 6:06 am Post subject: |
|
Dim retVal as Long
retVal = Shell("C:\MyFolder\MyProg.exe")
I would have put the path to the 'net send' command in there, but I'm not familiar with it. It's an executable right?
The shell command will run the executable in a command window... it think minimized by default, but you can change that with a second optional argument to the function. I think the return value is the handle for the new command window.
The executable will lauch and continue on in your code. So it is not going to wait until it finishes executing before the rest of your procedure is executed. |
_________________
|
|
|
|
|
Lycander
Lead Dog


Joined: 24 May 2002 Age: 25 Posts: 12198
Location: The Constitution State
|
Posted:
Thu Oct 16, 2003 6:10 am Post subject: |
|
Try this:
http://msdn.microsoft.com/library/en-us/vbenlr98/html/vafctShell.asp?frame=false
The return value is the "task ID" according to the doc, so I think that means the Process ID (a term we're more familiar with). You'll have to hold onto that ID number to get info on the process afterwards, or to programmatically kill it. |
_________________ To the top of hunger mountain
I found my solitary ways
Where I could live on nuts and honey
And take my shelter in a cave
|
|
|
|
|
T
Curmudgeon

Joined: 17 May 2001 Posts: 16184
Location: Airstrip One
|
Posted:
Thu Oct 16, 2003 6:26 am Post subject: |
|
Why call an external process? Why not just interact with the Alerter or Messenger service directly from your program? |
_________________ Got questions? Click here.
Still got questions? Click here, too.
affabletoaster, Akely, anglachel, blahpony, CMTG, EdisonRex, Elk, Equin, evilness, Fido, fathertyme, Goddess, Jaymac, je, jodygirl, KingKobra, Lycander, mally, Max, OhioArt2, perrito_blanco, Rover, Spot, sully_51, Superdwarf, the taz man, thriftyjack, twiztid, wrathiron, yiayia49
Would you like good music at a price that is right? CD Baby, baby.
You look like you need a monkey.
|
|
|
|
|
Daftlad
Stray Dog

Joined: 14 Oct 2003 Posts: 7
Location: England
|
Posted:
Thu Oct 16, 2003 9:32 am Post subject: |
|
Demon wrote:Why call an external process? Why not just interact with the Alerter or Messenger service directly from your program?
This is a great idea BUT ! ha how lol ! haha
Take a break have a look at http://www.misternicehands.com |
_________________ "Its not the size of the wand, its the magic in the stick.."
|
|
|
|
|
|
|