Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


hide dos box

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,54125
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> hide dos box
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 hide dos box - 12/10/2007 1:24:55 AM   
  BMeX

 

Posts: 6
Score: 0
Joined: 12/10/2007
Status: offline
Hello Everybody!

I hope you can help me!

When I do a ping, I have to log the number of miliseconds (availability). With the following code, I do the ping and store
the return value in string "sCMT_Ping":

CODE:
sServer = "ServerXY"
sCMD = "%comspec% /c ping -n 1 " & sServer                
WScript.Sleep sDelay                            
Set objExec = objShell.Exec(sCMD)                       
sCMT_Ping = objExec.StdOut.ReadAll


My problem now is, that the dos box every time is popping up and that is bothersome, if I have 16 servers to ping in succession.
Can you help me? I know, an alternative is, that I use objShell.Run but it only returns me a number and I have to analyse the
availability in miliseconds. I read too, that i can not hide the dosbox with objShell.Exec() but I think anyone of you can help me surely.

KR, BMeX
 
 
Post #: 1
 
 RE: hide dos box - 12/10/2007 2:33:58 AM   
  ebgreen


Posts: 5250
Score: 31
Joined: 7/12/2005
Status: offline
Have a look at the .Run method of the WshShell object. You can use it to specifiy that the command be run minimized. Unfortunately it does not give access to STDOUT so you will need to have the command pipe it's output to a temp file then read the file. You could also consider using WMI to ping and then there wouldn't be a window to deal with at all.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to BMeX)
 
 
Post #: 2
 
 RE: hide dos box - 12/10/2007 5:07:33 AM   
  mcds99


Posts: 441
Score: 4
Joined: 2/28/2006
Status: offline
Take a look at WMI Ping as well it uses the local WMI interface to do the pings it's faster and has return codes that can
be used in troubleshooting :-)

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to BMeX)
 
 
Post #: 3
 
 RE: hide dos box - 12/10/2007 7:14:40 PM   
  BMeX

 

Posts: 6
Score: 0
Joined: 12/10/2007
Status: offline
Hello Everybody

Thanks for help, i looked for wmi ping in google and i exactly found what I have need.
Have a look at: http://cwashington.netreach.net/depo/view.asp?Index=1059

I never get this out without your help.
Thanks again!

BMeX

P.S. I'm sorry, my english is bad but the other people can't help me. But I see, you understood me :-)


(in reply to BMeX)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> hide dos box Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts