954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

"HELP" RUNNING MSDOS COMMAND ON VB

I Am A Vb On Excell User, I Am Trying To Make A Macro In Visual Basic But I Do Not Know How To Run A Msdos Comand Over Vb
In Specific I Want To Excecute A "ping" Command Over A Macro That Help Me To Se If A Computer Is On Line And Record On A Excell Worksheet, omeone Can Help Me How To Do It?

Ivan Ruiz
Newbie Poster
1 post since Sep 2004
Reputation Points: 10
Solved Threads: 0
 
I Am A Vb On Excell User, I Am Trying To Make A Macro In Visual Basic But I Do Not Know How To Run A Msdos Comand Over Vb In Specific I Want To Excecute A "ping" Command Over A Macro That Help Me To Se If A Computer Is On Line And Record On A Excell Worksheet, ⿳omeone Can Help Me How To Do It?

Although I don't use VB but rather PowerBasic for windows, maybe this will be of some use (hopefully).

Example:
Assume you have written or have a batch file.
use:

SHELL ENVIRON$("COMSPEC") + " /c " + batfilename$

Probably would work with commands too.

Buff
Light Poster
40 posts since May 2004
Reputation Points: 11
Solved Threads: 0
 

Actually, if your using VB6, I'm pretty sure you could just do Shell("C:\path\to\ping.ext localhost")

Tekmaven
Software Architect
Moderator
1,274 posts since Feb 2002
Reputation Points: 322
Solved Threads: 28
 

Hi, all

Have you ever try it with windows api.

Regard

Hok Sun

[email]Hoksun13@hotmail.com[/email]

HokSun
Newbie Poster
1 post since Jun 2004
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You