Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


nslookup of dns ipaddress - dos box appears :-(

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> nslookup of dns ipaddress - dos box appears :-(
  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 >>
 nslookup of dns ipaddress - dos box appears :-( - 5/28/2008 6:38:47 PM   
  BMeX

 

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

I already wrote a thread like this, but i do not get ahead with the other reason.

So, I have to get the hostname of my primary dns server. First I will identify the IP-Adress of my primary dns - Thats no problem, it works. Then i want to have the hostname, so i have to do a nslookup to the ip address. I do this with the following code:

Set oShell = CreateObject("Wscript.Shell")
Set oExec = oShell.Exec("nslookup " & sPrimaryDNS_IP)
   Do Until oExec.StdOut.AtEndOfStream
        sNsLookUp_ReturnValue = oExec.StdOut.ReadAll
   Loop
Set oExec = Nothing
MsgBox sNsLookUp_ReturnValue

This code works too, BUT everytime I execute this, a dos box appears. finally this code will be used as a part of a logonscript and then it annoys, if a dos box appears everytime you log in.
Now i want hide this dos box, but i do not know how i can do that? If it is possible, it would be very nice if i can do this without any tools, only with vbscript.
As far as i know, if i execute this command with "Run", it is not possible to get a return value to edit?

I tried a WMI-Procedure too, but fot this i need to be an administrator, that shuldn't be like this.

I hope you can help me, i'm on the ropes :-)

Thanks,

KR BMeX


P.S. I'm sorry, but i hope you can understand me or my problem :-) my english is not the best as you see.
 
 
Post #: 1
 
 RE: nslookup of dns ipaddress - dos box appears :-( - 5/29/2008 12:15:42 AM   
  dm_4ever


Posts: 2664
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
If you run your script using CScript it shouldn't show the dos box
Alternately, you can use the Run method, pipe out the output to a text file, and then read that text file for the values

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to BMeX)
 
 
Post #: 2
 
 
 
  

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 >> nslookup of dns ipaddress - dos box appears :-( 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