Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-12-28 Thread Rainer Stratmann via fpc-pascal
May be that helps a little bit. Please give a feedback if it works or not or if you can improve it. I use the curl library directly. Not on the command line. {$ifdef windows} uses sockets , winsock2; procedure adds2( var dw : dword ; p : pointer ); var addr : pinaddr; begin addr := p; if add

Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-09-10 Thread Travis Siegel via fpc-pascal
I don't know how much it will help, but windows has a similar command to linux ifconfig, only on windows it's called ipconfig. Hope this helps. On 9/10/2021 3:03 AM, Bo Berglund via fpc-pascal wrote: Is there a way to enumerate the active adapters on a Windows computer with their IPv4 and MAC

Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-09-10 Thread Bo Berglund via fpc-pascal
On Fri, 10 Sep 2021 09:46:11 +0200, Sven Barth via fpc-pascal wrote: >You can use the ipconfig command and parse its output (especially ipconfig >/all). I also figured that to be the case, so I will run TProcess with Ipconfig /all and then parse the result line by line. It looks like there is a

Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-09-10 Thread Marco van de Voort via fpc-pascal
Op 10-9-2021 om 09:46 schreef Sven Barth via fpc-pascal: You can use the ipconfig command and parse its output (especially ipconfig /all). Afaik netsh has more info. I have several tests  for this in Delphi, but they use the iphlp headers that FPC doesn't have yet (a point on my todo list).

Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-09-10 Thread Michael Van Canneyt via fpc-pascal
On Fri, 10 Sep 2021, James Richters wrote: Well, that sure is a lot simpler than parsing the IPConfig output! Is there a way to capture the MAC address this way as well? I don't know, I never needed that. uses {$IFDEF MSWINDOWS}Windows, WinSock,{$ENDIF} Should have a ; at the end instead

Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-09-10 Thread James Richters via fpc-pascal
Well, that sure is a lot simpler than parsing the IPConfig output! Is there a way to capture the MAC address this way as well? uses {$IFDEF MSWINDOWS}Windows, WinSock,{$ENDIF} Should have a ; at the end instead of a , uses {$IFDEF MSWINDOWS}Windows, WinSock;{$ENDIF} James

Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-09-10 Thread James Richters via fpc-pascal
>You can use the ipconfig command and parse its output (especially ipconfig >/all). Here’s how I use ipconfig and parse the output: https://gist.github.com/Zaaphod/d1b7bf7a29aa653e3b0b61a836a03f62 James ___ fpc-pascal maillist - fpc-pascal@lists.fr

Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-09-10 Thread Michael Van Canneyt via fpc-pascal
On Fri, 10 Sep 2021, Sven Barth via fpc-pascal wrote: Bo Berglund via fpc-pascal schrieb am Fr., 10. Sep. 2021, 09:41: Is there a way to enumerate the active adapters on a Windows computer with their IPv4 and MAC addresses? There is an API for that, but I don't remember that right now.

Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-09-10 Thread Sven Barth via fpc-pascal
Bo Berglund via fpc-pascal schrieb am Fr., 10. Sep. 2021, 09:41: > Is there a way to enumerate the active adapters on a Windows computer with > their > IPv4 and MAC addresses? > There is an API for that, but I don't remember that right now. > I am trying to convert a Linux reporting script to

[fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-09-10 Thread Bo Berglund via fpc-pascal
Is there a way to enumerate the active adapters on a Windows computer with their IPv4 and MAC addresses? I am trying to convert a Linux reporting script to Windows, but I have a hard time finding a suitable Windows command. The script uses common Linux commands and tools to get the eth0 and wlan0