Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell only outputting first two lines

Status
Not open for further replies.

Sandman83

Programmer
Sep 11, 2001
122
0
0
US
Hi All;

I am trying to use Access to to get the IP Address of multiple PC's via NSLookup. I am using the following code to output the information to a txt file;

When ever I run this code from an Access module I only get the first two lines of output.
Code:
dblRetVal = Shell("cmd /c nslookup.exe [i]hostname[/i] > C:\NSLOOKUPDATA.TXT", vbHide)

Server: servername.work.com
Address: 10.55.224.100

If I copy and paste
Code:
cmd /c nslookup.exe [i]hostname[/i] > C:\NSLOOKUPDATA.TXT
into a command prompt I get all five (If you count the blank line as the third line) expected lines of output.

Server: servername.work.com
Address: 10.55.224.100

Name: pcname.work.com
Address: 10.11.89.115

Any ideas why this would be happening?

Thanks in advance,

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top