Re: Computer information using psexec by TitoNoHo
TitoNoHo
Fri Feb 01 17:18:27 CST 2008
Thank you for your help the batch file was good to acomplish what I want by
the way the VBScript still not passing the value of the IP when I run it
still, with other words look like is a string insted of the value of IP.
sorry I very new at VBScript and I still have long way to go thank you for
your help I was thinking to give a different aproche to me problem because I
only need IP address MAC address and computer name I thinking using
objItem.MACAddress and objItem.IPAddress well for user you will see my
question one more time thank you.
"Pegasus (MVP)" wrote:
>
> "TitoNoHo" <TitoNoHo@discussions.microsoft.com> wrote in message
> news:3A7377B5-ECB2-4F83-9E32-40E8BD6E0B10@microsoft.com...
> >I try to create a scritp to write to a file with the computer information,
> >I
> > like to input the computer name or ip and then execute ipconfig remotly
> > this
> > is my initial script but I having trouble with the var, my gold is to read
> > a
> > file with all the computer names and create a file fromt there.
> >
> > Dim ip
> > dim oShell
> >
> > ip=InputBox("Enter computer IP or name:")
> >
> >
> > Set oShell = WScript.CreateObject ("WSCript.shell")
> >
> > oShell.run "cmd /K CD C:\ & psexec \\[ip] ipconfig /all> [ip].txt"
> >
> > Set oShell = Nothing
> >
> > Thank you .
>
> Since you're not really making use of any essential VB Script
> features, it would be far simpler to use a humble batch file
> to achieve your aim. Below is a solution for each approach.
> Note that you have to be very careful with your double quotes
> when using VB Scripts.
>
> IP=InputBox("Enter computer IP or name:")
> Set oShell = WScript.CreateObject ("WSCript.shell")
> oShell.run "cmd /c psexec.exe \\" & IP & " ipconfig /all> ""C:\" & IP &
> ".txt"""
>
> @echo off
> set /p PC=Enter computer IP or name:
> psexec.exe \\%PC% ipconfig /all > c:\%PC%.txt
>
>
>