Hi,
I may be getting vbs and VB a little comfused here, but I am trying to create a little script that will run the command Net View | Find "InsertVariableHere" I've gotten pretty close, but cannot get any output. Here is my code:
' VBScript File
Dim strName
strName = InputBox("Who's Station?","Find Station","Enter Name Here")
Set objShell = CreateObject("WScript.Shell")
Set objScriptExec = objShell.Exec("Net View | find" & strName)
strStation = objScriptExec.StdOut.ReadAll
WScript.Echo strStation
If I take out the "| Find & strName" peice, it gives me a nice list of stations on my network. If you copy and paste this code to a .vbs file, you will probably see what I'm trying to do. should be simple, but I'm not really a programmer.
Any help is appreciated. Thanks.
Mark.
I may be getting vbs and VB a little comfused here, but I am trying to create a little script that will run the command Net View | Find "InsertVariableHere" I've gotten pretty close, but cannot get any output. Here is my code:
' VBScript File
Dim strName
strName = InputBox("Who's Station?","Find Station","Enter Name Here")
Set objShell = CreateObject("WScript.Shell")
Set objScriptExec = objShell.Exec("Net View | find" & strName)
strStation = objScriptExec.StdOut.ReadAll
WScript.Echo strStation
If I take out the "| Find & strName" peice, it gives me a nice list of stations on my network. If you copy and paste this code to a .vbs file, you will probably see what I'm trying to do. should be simple, but I'm not really a programmer.
Any help is appreciated. Thanks.
Mark.