A Scripting Language for Web, Linux and Windows

A Scripting Language for Web, Linux and Windows

Example: Working with the Windows registry

The follwing system functions can be used to work with the Windows registry: getreg(), putreg(), delreg()

<?v1
/* 
    Working with the Windows registry
*/

// Read all registry keys and values as array
regKey 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run';
keyList getreg(regKey);
print_r (keyList);

// Read specific key
value getreg (regKey"MyKey"));

// Create a new registry sub tree
regKey "Software\\Microsoft\\Windows\\CurrentVersion\\Run";
putreg (regKey"SubTree");

// Add a key/value pair
putreg (regKey."\\SubTree""Key""Value");

// Add a key/value pair as 32 Bit DWORD
myNum 0xFFFFFFFF;
putreg (regKey."\\SubTree""Key 2"myNum1);

// Delete the whole sub tree
delreg (regKey"SubTree"1);

?>

back to Home