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 .

Re: Computer information using psexec by Pegasus

Pegasus
Fri Feb 01 15:09:44 CST 2008


"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



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
>
>
>

Re: Computer information using psexec by Pegasus

Pegasus
Fri Feb 01 17:30:58 CST 2008

My VB Script worked perfectly well for me. If it does
not work for you then there is a flaw in your version
of the script. Post it so that we can see it!


"TitoNoHo" <TitoNoHo@discussions.microsoft.com> wrote in message
news:87116317-AAF6-482F-8515-BBF8F540621D@microsoft.com...
>
> 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
>>
>>
>>



Re: Computer information using psexec by TitoNoHo

TitoNoHo
Fri Feb 01 17:39:01 CST 2008

sorry about that my miss take !!!!
Like you say I have to be carfull with those "

one more time thank you!!!!!


"Pegasus (MVP)" wrote:

> My VB Script worked perfectly well for me. If it does
> not work for you then there is a flaw in your version
> of the script. Post it so that we can see it!
>
>
> "TitoNoHo" <TitoNoHo@discussions.microsoft.com> wrote in message
> news:87116317-AAF6-482F-8515-BBF8F540621D@microsoft.com...
> >
> > 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
> >>
> >>
> >>
>
>
>