psexec.exe problem running a netstat on remote server
From: Mike Ouimet (mike_ouimet_at_premierinc.com)
Date: 06/16/04
- Next message: Björn Holmgren: "Re: What gets changed when a DLL is registered, in particular how much space is used?"
- Previous message: Don_at_home.com: "Re: Location of .ocx and .dll files?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 16 Jun 2004 04:14:06 -0700
I am trying to use the WScript.Shell command to execute a netstat using
psexec (from sysinternals) against remote servers. The problem is I get
an error back from what appears to be from netstat.
The error is:
netstat.exe exited on Servername with error code 1.
Any ideas what the problem could be? I have a huntch it's character
related because if I just run the same command from the command prompt
on my machine it runs fine and I get a value back. I can even run the
netstat.exe -a from with the vbscript but as soon as the next character
of | is added to separate the "find" command I get the error code from
above. If I try to do just netstat -a -o it runs fine however I simply
do not get all the results back from the netstat in my window nor if I
try to pipe to a txt file.
Here is how I am building my exec path and executing:
command_exec = "psexec.exe"
cmdNetStat = "netstat.exe -a | find /C " & Chr(34) & ":33569" &
Chr(34)
strPath = cmdNetStat
Set objWshShell = CreateObject("WScript.Shell")
Set objExec = objWshShell.Exec (strPath)
Set objStdOut = objExec.StdOut
strResult = objStdOut.ReadAll
WScript.Echo strResult
Thanks a bunch!
Mike O
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
- Next message: Björn Holmgren: "Re: What gets changed when a DLL is registered, in particular how much space is used?"
- Previous message: Don_at_home.com: "Re: Location of .ocx and .dll files?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|