Get data from Windows Registry with PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
siskokid
Forum Newbie
Posts: 9
Joined: Mon Jun 25, 2007 2:10 am

Get data from Windows Registry with PHP

Post by siskokid »

Good mourning :)

Could anyone help me with the following task:

I need to drag some information of the Windows' Registry using PHP. I need the following:

IP Address, DNS Address, DNS Suffix and DHCP.

These variables are located under:

SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces

Could you please help me with a sample of code :)

I know how to do it with VBScript. So in this connection, another valuable piece of help would be to give me a piece of PHP code, which would help me to "implant" my VBScript into the PHP code. I mean, I need the VBScript to be called by the PHP and executed on the fly :)

Any help will be appreciated :)

Best,
siskokid
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

You can create a form and ask them for the information.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

siskokid
Forum Newbie
Posts: 9
Joined: Mon Jun 25, 2007 2:10 am

Post by siskokid »

Hi Hockey,

Thanks for the link, but I would rather not use this way (experimental, some functions may not work under different versions of PHP, etc.). I need something robust and general. Could you please help me in another way :)

I will really appreciate the help!

Best,
siskokid
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Code: Select all

system('ipconfig /all');
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: Get data from Windows Registry with PHP

Post by superdezign »

siskokid wrote: know how to do it with VBScript. So in this connection, another valuable piece of help would be to give me a piece of PHP code, which would help me to "implant" my VBScript into the PHP code. I mean, I need the VBScript to be called by the PHP and executed on the fly
Can't you use VBScript through <script> tags?
siskokid
Forum Newbie
Posts: 9
Joined: Mon Jun 25, 2007 2:10 am

Post by siskokid »

Hi volka, hi superdezign :)

I knew about the system() command, but I have to parse the string after I get the result, which also could be a solution. I want to directly get the data instead. Could you please help me with the sintax of the <script> tags, which would allow me to use my VBScript. I am interested in how do you pass a variable through the tags to the VBScript and how do you pass the resulting variable back to PHP.

Thanks in advance,
siskokid
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

<script type="text/vbscript">, that would be a client-side script and I don't know if any any browser besides internet explorer executes vbscripts. And even the IE will probably not allow arbitrary scripts to access the registry.
Post Reply