LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Hide WScript Command window

This code gives the IP address of the computer. It however displays a
command window momentarily. How can I prevent the window from being
displayed ? Thanks.

Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")

Set oExec = WshShell.Exec("%comspec% /c ipconfig")

Do While oExec.stdOut.AtEndOfStream < True
StrLine = oExec.stdOut.Readline

If InStr(StrLine, "Address") 0 Then
'found
strIP = StrLine
Exit Do
End If
Loop

MsgBox Mid(strIP, (InStr(strIP, ":") + 2))


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide Command Shell window Corey Excel Programming 0 November 20th 06 06:08 AM
Hide Window Caption Bar Mats Nilsson Excel Programming 4 August 28th 06 07:02 PM
How do I undo the Excel, Window Menu, New Window command OLDFANG Excel Discussion (Misc queries) 2 March 17th 06 05:31 PM
using WScript.CreateObject("Wscript.Shell John Keith[_2_] Excel Programming 3 August 30th 05 07:20 PM
Practical use of Window Hide Tetsuya Oguma[_4_] Excel Programming 1 August 5th 04 06:50 AM


All times are GMT +1. The time now is 10:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"