Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/lua-winreg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_5_1_6.lua')
-rw-r--r--test/test_5_1_6.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test_5_1_6.lua b/test/test_5_1_6.lua
new file mode 100644
index 0000000..615720f
--- /dev/null
+++ b/test/test_5_1_6.lua
@@ -0,0 +1,20 @@
+local winreg = require"winreg"
+-- Enumerate start up programs
+
+rkey = "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"
+hkey = winreg.openkey(rkey)
+
+print('\n'..rkey..":")
+for name, kind in hkey:enumvalue() do
+ print("\nname: " .. name
+ .. "\ncommand: " .. hkey:getvalue(name))
+end
+
+rkey = "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce"
+hkey = winreg.openkey(rkey)
+
+print('\n'..rkey..":")
+for name, kind in hkey:enumvalue() do
+ print("\nname: " .. name
+ .. "\ncommand: " .. hkey:getvalue(name))
+end