Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Want WinIpCfg info from VFP
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00281321
Message ID:
00281496
Views:
14
>How do you get the same information provided by ‘WinIpCfg’ programmatically from within VFP.

the easiest way would be to run WINIPCFG and direct the output to a file, then read and parse the file. WINIPCFG takes an optional command line parameter /BATCH, that allows output to a file without echoing to a screen. For example

WINIPCFG /BATCH IPCFG.DAT

creates a file IPCFG.DAT in the current working directory. You could run WINIPCFG using the native VFP RUN command eg:

RUN /N0 WINIPCFG /BATCH IPCFG.DAT

or use the ShellExecute FFC class under VFP6, or the ShellExecute() or ShrellExecuteEx() or CreateProcess() API calls to do the same thing (my API_APPRUN class does this using Createprocess().)

Realize that WINIPCFG exists in Win9x only; under NT, IPCONFIG produces similar output (it exists under Win98 and Win2K as well, but not original Win95.)

You can also extract the same information using either Win32 API calls (a lot of them) or the WinSock ActiveX control. Rick Strahl's wwIPStuff class provides much of the functionality you'd want conveniently through a VFP class, and is available for download (there's also a commercial version available with more functionality.) Similar functionality is available from a number of third-party ActiveX controls as well.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform