HighTechTalks DotNet Forums  

nbtstat code failure

Dotnet Scripting microsoft.public.dotnet.scripting


Discuss nbtstat code failure in the Dotnet Scripting forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Kendoh
 
Posts: n/a

Default nbtstat code failure - 04-01-2005 , 02:39 PM






I am running the following simple code to display nbtstat information.
However when I execute the code it doesn't display the netbios table. What
changes do i need to make to get the table to display? Much appreciated.

Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("nbtstat /a")
Set objStdOut = objWshScriptExec.StdOut

strLine = objStdOut.ReadAll
WScript.Echo strLine




Reply With Quote
  #2  
Old   
Philippe l. Balmanno
 
Posts: n/a

Default Re: nbtstat code failure - 04-02-2005 , 10:44 AM






I when I run the script cmd.exe flashes by with speedy text on my system.
Could your system be producing the same? Or does your system know where
nbstat.exe exists? Do you want a text file output or it to display on the
screen for a while/

"Kendoh" <Kendoh (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am running the following simple code to display nbtstat information.
However when I execute the code it doesn't display the netbios table.
What
changes do i need to make to get the table to display? Much appreciated.

Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("nbtstat /a")
Set objStdOut = objWshScriptExec.StdOut

strLine = objStdOut.ReadAll
WScript.Echo strLine






Reply With Quote
  #3  
Old   
Philippe l. Balmanno
 
Posts: n/a

Default Re: nbtstat code failure - 04-02-2005 , 10:53 AM



Also when you run nbtstat.exe in a cmd.exe environment, I believe the
command is nbtstat -a not /a.

"Kendoh" <Kendoh (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am running the following simple code to display nbtstat information.
However when I execute the code it doesn't display the netbios table.
What
changes do i need to make to get the table to display? Much appreciated.

Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("nbtstat /a")
Set objStdOut = objWshScriptExec.StdOut

strLine = objStdOut.ReadAll
WScript.Echo strLine






Reply With Quote
  #4  
Old   
Philippe l. Balmanno
 
Posts: n/a

Default Re: nbtstat code failure - 04-02-2005 , 10:55 AM



Forgive me, I forgot to say you use the adapter or IP as the identifier as
in nbtstat -a 192.168.1.1 etc. in the use of this command.

"Kendoh" <Kendoh (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am running the following simple code to display nbtstat information.
However when I execute the code it doesn't display the netbios table.
What
changes do i need to make to get the table to display? Much appreciated.

Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("nbtstat /a")
Set objStdOut = objWshScriptExec.StdOut

strLine = objStdOut.ReadAll
WScript.Echo strLine






Reply With Quote
  #5  
Old   
Michael Harris \(MVP\)
 
Posts: n/a

Default Re: nbtstat code failure - 04-02-2005 , 02:00 PM



Kendoh wrote:
Quote:
I am running the following simple code to display nbtstat information.
However when I execute the code it doesn't display the netbios table.
What changes do i need to make to get the table to display? Much
appreciated.

Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("nbtstat /a")
Set objStdOut = objWshScriptExec.StdOut

strLine = objStdOut.ReadAll
WScript.Echo strLine

Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("nbtstat /a %computername%")

Do While objWshScriptExec.Status = 0
WScript.Sleep 100
Loop

Set objStdOut = objWshScriptExec.StdOut

strLine = objStdOut.ReadAll
WScript.Echo strLine



--
Michael Harris
Microsoft MVP Scripting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Please ask follow-up questions via the original newsgroup thread.





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.