
Redirecting output from WshShell.RUN
I'm a newbie at WSH, so please be gentle! I'm trying to write a small
VBScript front end to the SRVINFO.EXE, found on the NT Resource Kit. I want
the script to prompt for the Server name, and then, when running the
program, redirect the output to a text file. However, it keeps giving the
usage of the command (i.e It doesn't work). After a little troublshooting,
I figured out the problem is in the part of the command that redirects it to
the text file. HELP! Below I've included the code. I'd appreciate any
assistance. Thanks.
'###CODE
DIM servername
servername=Inputbox("Enter name of Server you want to run SRVINFO.EXE on.",
"VBServer_Info")
if servername="" then
wscript.echo "No server name was entered; quiting program."
wscript.quit(1)
end if
Set WshShell=Wscript.CreateObject("Wscript.Shell")
WshShell.Run ("srvinfo \\" & servername & " " & "> " & servername & ".txt")