Ok so here's teh deal i am totally new to scripting but managed to
create a script in which a prograame called pslist(a tool to log
process data) runs from a locotion on the drive and also checks a file.
This script works fine but only on local system and for local
processes.

I included in the script an input box for user to input the ip address
of the remote machine.

But i dunno how to use this Input data within my script to run pslist
with the remote machine switch.

The code is below, Please any help would be really great.

Option Explicit
Dim objFSO,Input
Dim objShell,strSysDrive
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strSysDrive = objShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%")
If objFSO.FileExists (strSysDrive & "\testfolder\ps.txt") Then
Wscript.Echo "Change the name of PSLIST log files before running
another test"
Wscript.Quit
Else
Input = InputBox("Enter the IP Address or the name of the remote
server")
objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe
pslist -s \\ "
objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe
pslist -s >>%systemdrive%\RMQCA\ps.txt"
End If

Input = InputBox("Enter the IP Address or the name of the remote
server")--->> this is what will give the user to fill in the ip
address.

objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe
pslist -s \\ --->> this is where i need that ipaddress to be so that i
can run pslist like :

pslist -s \\ipaddress

I hope i explained what i am after. Thank you all once again

Re: Help Needed Please -- input function and using the input by Jim

Jim
Wed Jun 07 11:34:51 CDT 2006

here you store the IP in a variable called "Input"
Input = InputBox("Enter the IP Address or the name of the remoteserver")

now just append the variable to the end of the command
objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe -s \\"
& Input






"singh" <harmeetsandhu@gmail.com> wrote in message
news:1149696481.807409.111480@f6g2000cwb.googlegroups.com...
> Ok so here's teh deal i am totally new to scripting but managed to
> create a script in which a prograame called pslist(a tool to log
> process data) runs from a locotion on the drive and also checks a file.
> This script works fine but only on local system and for local
> processes.
>
> I included in the script an input box for user to input the ip address
> of the remote machine.
>
> But i dunno how to use this Input data within my script to run pslist
> with the remote machine switch.
>
> The code is below, Please any help would be really great.
>
> Option Explicit
> Dim objFSO,Input
> Dim objShell,strSysDrive
> Set objShell = CreateObject("WScript.Shell")
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> strSysDrive = objShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%")
> If objFSO.FileExists (strSysDrive & "\testfolder\ps.txt") Then
> Wscript.Echo "Change the name of PSLIST log files before running
> another test"
> Wscript.Quit
> Else
> Input = InputBox("Enter the IP Address or the name of the remote
> server")
> objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe
> pslist -s \\ "
> objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe
> pslist -s >>%systemdrive%\RMQCA\ps.txt"
> End If
>
> Input = InputBox("Enter the IP Address or the name of the remote
> server")--->> this is what will give the user to fill in the ip
> address.
>
> objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe
> pslist -s \\ --->> this is where i need that ipaddress to be so that i
> can run pslist like :
>
> pslist -s \\ipaddress
>
> I hope i explained what i am after. Thank you all once again
>



Re: Help Needed Please -- input function and using the input by singh

singh
Thu Jun 08 04:08:19 CDT 2006

Jim Thank you so much for your hrlp it worked like a treat. Mate if you
have time can you let me know how i can use this input in the second
code line to save the Text file with the input name and time and date
stamp.

So objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe
pslist -s >>%systemdrive%\RMQCA\ps.txt"----->> so saving this text file
with input and date and time stamp.

Jim thank you once again for all your help.

Jim wrote:
> here you store the IP in a variable called "Input"
> Input = InputBox("Enter the IP Address or the name of the remoteserver")
>
> now just append the variable to the end of the command
> objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe -s \\"
> & Input
>
>
>
>
>
>
> "singh" <harmeetsandhu@gmail.com> wrote in message
> news:1149696481.807409.111480@f6g2000cwb.googlegroups.com...
> > Ok so here's teh deal i am totally new to scripting but managed to
> > create a script in which a prograame called pslist(a tool to log
> > process data) runs from a locotion on the drive and also checks a file.
> > This script works fine but only on local system and for local
> > processes.
> >
> > I included in the script an input box for user to input the ip address
> > of the remote machine.
> >
> > But i dunno how to use this Input data within my script to run pslist
> > with the remote machine switch.
> >
> > The code is below, Please any help would be really great.
> >
> > Option Explicit
> > Dim objFSO,Input
> > Dim objShell,strSysDrive
> > Set objShell = CreateObject("WScript.Shell")
> > Set objFSO = CreateObject("Scripting.FileSystemObject")
> > strSysDrive = objShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%")
> > If objFSO.FileExists (strSysDrive & "\testfolder\ps.txt") Then
> > Wscript.Echo "Change the name of PSLIST log files before running
> > another test"
> > Wscript.Quit
> > Else
> > Input = InputBox("Enter the IP Address or the name of the remote
> > server")
> > objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe
> > pslist -s \\ "
> > objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe
> > pslist -s >>%systemdrive%\RMQCA\ps.txt"
> > End If
> >
> > Input = InputBox("Enter the IP Address or the name of the remote
> > server")--->> this is what will give the user to fill in the ip
> > address.
> >
> > objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe
> > pslist -s \\ --->> this is where i need that ipaddress to be so that i
> > can run pslist like :
> >
> > pslist -s \\ipaddress
> >
> > I hope i explained what i am after. Thank you all once again
> >