Récupéré l'IP en formules

Toutes les astuces sur le langage de formule

Récupéré l'IP en formules

Messagepar Michael DELIQUE » 07 Mars 2011 à 13:12

Steph_ a écrit:je viens de tester ça sur environ 150 machines en XP, et pour le moment ça marche à 100%


[syntax="Formula"]keywin := @RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet001\\Services\\RemoteAccess\\Interfaces\\2"; "InterfaceName");
deb := "SYSTEM\\ControlSet001\\Services";
fin := "Parameters\\Tcpip";
@RegQueryValue("HKEY_LOCAL_MACHINE"; deb +"\" +keywin+"\"+fin; "DhcpIpAddress")[/syntax]
Cordialement

Michael (SMS-Phobique)
----------------------------
"La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi."
Albert EINSTEIN
Avatar de l’utilisateur
Michael DELIQUE
Administrateur
Administrateur
 
Message(s) : 12183
Inscrit(e) le : 16 Déc 2004 à 10:36
Localisation : Paris/Cergy

Messagepar Michael DELIQUE » 08 Mars 2011 à 16:32

je me suis amusé à faire un pseudo ipconfig en @formule

Code : Tout sélectionner
keywin := @RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet001\\Services\\RemoteAccess\\Interfaces\\2"; "InterfaceName");

"DhcpIpAddress: "+@RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet001\\Services\\" +keywin+"\\Parameters\\Tcpip"; "DhcpIpAddress")+@NewLine+
"DhcpDefaultGateway : "+@RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet001\\Services\\" +keywin+"\\Parameters\\Tcpip"; "DhcpDefaultGateway")+@NewLine+
"DhcpServer : "+@RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet001\\Services\\" +keywin+"\\Parameters\\Tcpip"; "DhcpServer")+@NewLine+
"DhcpSubnetMask : "+@RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet001\\Services\\" +keywin+"\\Parameters\\Tcpip"; "DhcpSubnetMask")+@NewLine+
"IPAddress : "+@RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet001\\Services\\" +keywin+"\\Parameters\\Tcpip"; "IPAddress")+@NewLine+
"SubnetMask : "+@RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet001\\Services\\" +keywin+"\\Parameters\\Tcpip"; "SubnetMask")+@NewLine+
"ComputerName : "+@RegQueryValue("HKEY_CURRENT_USER";"Software\\Microsoft\\Windows Media\\WMSDK\\General"; "ComputerName")+@NewLine+
"DhcpDomain : "+@RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet003\\Services\\Tcpip\\Parameters\\Interfaces\\" +keywin; "DhcpDomain")+@NewLine+
"NameServer : "+@RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet003\\Services\\Tcpip\\Parameters\\Interfaces\\" +keywin; "NameServer")+@NewLine+
"Domain : "+@RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet003\\Services\\Tcpip\\Parameters\\Interfaces\\" +keywin; "Domain")+@NewLine+
"DhcpServer : "+@RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet003\\Services\\Tcpip\\Parameters\\Interfaces\\" +keywin; "DhcpServer")+@NewLine+
"DhcpIPAddress : "+@RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet003\\Services\\Tcpip\\Parameters\\Interfaces\\" +keywin; "DhcpIPAddress")+@NewLine+
"DhcpSubnetMask : "+@RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet003\\Services\\Tcpip\\Parameters\\Interfaces\\" +keywin; "DhcpSubnetMask")+@NewLine+
"DhcpNameServer : "+@RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet003\\Services\\Tcpip\\Parameters\\Interfaces\\" +keywin; "DhcpNameServer")+@NewLine+
"DhcpDomain : "+@RegQueryValue("HKEY_LOCAL_MACHINE"; "SYSTEM\\ControlSet003\\Services\\Tcpip\\Parameters\\Interfaces\\" +keywin; "DhcpDomain")
Cordialement

Michael (SMS-Phobique)
----------------------------
"La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi."
Albert EINSTEIN
Avatar de l’utilisateur
Michael DELIQUE
Administrateur
Administrateur
 
Message(s) : 12183
Inscrit(e) le : 16 Déc 2004 à 10:36
Localisation : Paris/Cergy


Retour vers Formula