Page 1 of 1 1
Topic Options
#42075 - 2003-06-26 02:51 PM Return from SHELL ?
Stefan Olsson Offline
Fresh Scripter

Registered: 2003-06-05
Posts: 11
Loc: Sweden
[Moderator (Sealeopard): Moved thread form 'Scripts' to 'Starters' forum due to lack of script in body]

Back again! [Embarrassed] )
I need my script to fetch what a shell-command returns. To find out what kind of network card is installed on a computer I need (?) to run SHELL "ipconfig /all | find "Ethernet" | find /C "."", wich in the cmd-box returns the number of ethernetcards on the computer.
How do I fetch that return into a variable in the script?

Thankfull for help!!

[ 26. June 2003, 14:54: Message edited by: sealeopard ]

Top
#42076 - 2003-06-26 03:10 PM Re: Return from SHELL ?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Please take a look at the PIPE UDFs that have been posted in the UDF Forum.
_________________________
There are two types of vessels, submarines and targets.

Top
#42077 - 2003-06-26 03:21 PM Re: Return from SHELL ?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Gee whiz, I had a scriptlet all prepared and couldn't find this post ... as Richard H. would say "Holy peripatetic posts, Batman!" [love that line]

Might try this. I couldn't get the proper count using your findstr, doesn't matter:

code:
Break On 

$TEMP = "%TEMP%\IPCONFIG.TMP"

If Exist($TEMP)
Del $Temp
EndIf

SHELL '%COMSPEC% /C ipconfig /all | find /C "Ethernet" >"$TEMP"'

If Open(1,$TEMP) = 0
$Count = Val(ReadLine(1))
$= Close(1)
EndIf

?"Count=" $Count



[ 26. June 2003, 15:27: Message edited by: Shawn ]

Top
#42078 - 2003-06-27 05:29 AM Re: Return from SHELL ?
Stefan Olsson Offline
Fresh Scripter

Registered: 2003-06-05
Posts: 11
Loc: Sweden
Ahh! Thanks Shawn. Now I learned another usefull way of using Kix!!! This opens a lot of new sulotions for me!!
Thanks again! [Smile]
//Stefan

Top
#42079 - 2003-06-27 05:37 AM Re: Return from SHELL ?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
my pleasure, kix on my brother !
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 661 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.054 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org