×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Windows Specific

Reading the Registry by skiflyer
Posted: 27 Jul 04

Using the COM abilities of PHP it's trivial to read registry values from your windows SERVER.  This is alright for Web based activities, but often more useful when using PHP for standalone scripting.

Here's a simple example one can use to find out where the Microsoft .NET compiler executable is located on their machine.

CODE

$shell = new COM("WScript.Shell") or die("Requires Windows Scripting Host");


$devenvpath=$shell->RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\devenv.exe\\");

One thing I've overlooked a few times in the past is when cutting and pasting the value from regedit, you'll need to remember to escape the \'s by turning them into \\'s

Hope this helps.

Back to PHP FAQ Index
Back to PHP Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close