lloydie-t
asked on
How command results into stringlist.
I want to be able to read the results of a windows command into a stringlist. The following command:
getmac /v /fo csv | findstr Local
produces following results:
"Local Area Connection","Realtek RTL8102e Family PCI-E Fast Ethernet NIC (NDIS 6.0)","00-21-70-81-2C-96", "Media Disconnected"
"Local Area Connection 2","Bluetooth Personal Area Network","00-21-86-A6-6E-2 7","Media Disconnected"
I suspect that I will have to use shellexecute. Any advice welcome
getmac /v /fo csv | findstr Local
produces following results:
"Local Area Connection","Realtek RTL8102e Family PCI-E Fast Ethernet NIC (NDIS 6.0)","00-21-70-81-2C-96",
"Local Area Connection 2","Bluetooth Personal Area Network","00-21-86-A6-6E-2
I suspect that I will have to use shellexecute. Any advice welcome
ASKER
I don't seem to be able to execute 'getmac /v /fo csv | findstr Local > macaddr.dat' in tpc. Also I have just found out the shellexecute will run asyncronously from the app so it may be that the outputed file will not be available to read.
you need to wait for it to finish
see this thread:
http://delphi.newswhat.com/geoxml/forumhistorythread?groupname=borland.public.delphi.nativeapi.win32&messageid=439059cc$1@newsgroups.borland.com
see this thread:
http://delphi.newswhat.com/geoxml/forumhistorythread?groupname=borland.public.delphi.nativeapi.win32&messageid=439059cc$1@newsgroups.borland.com
i'm not that good at command line parsing myself yet,
i'm still in the process of learning it all
i use this reference
http://technet.microsoft.com/nl-be/library/bb491071(en-us).aspx
i'm still in the process of learning it all
i use this reference
http://technet.microsoft.com/nl-be/library/bb491071(en-us).aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
and then opening the file using a stringlist.loadfromfile
i suspect indeed you will need to use ShellExecute