Written by James McDonald

June 5, 2013

Thinking of storing settings in registry. Some sample code:

set oshell = createobject("wscript.shell")

apf = "HKEY_LOCAL_MACHINE\SOFTWARE\Settings"
settings = Array("user", "domain", "password", "host")
slug = apf & "\edi_transfer_"

' create APFoods key 
oshell.regwrite "HKLM\SOFTWARE\APFoods\" , "", "REG_SZ"

' create values
oshell.regwrite "HKLM\SOFTWARE\APFoods\edi_transfer_user" , _
				"username", _
				"REG_SZ"
oshell.regwrite "HKLM\SOFTWARE\APFoods\edi_transfer_domain" , _
				"domainname", _
				"REG_SZ"
oshell.regwrite "HKLM\SOFTWARE\APFoods\edi_transfer_password" , _
				"secret_password", _
				"REG_SZ"
oshell.regwrite "HKLM\SOFTWARE\APFoods\edi_transfer_host" , _
				"remote_host", _
				"REG_SZ"

set d = createobject("Scripting.Dictionary")

for each i in settings

		d.add i , oshell.regread(slug & i)

next

for each j in d.items

	wscript.echo j

next

for each k in d.keys

	wscript.echo d.item(k)

next

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Squarespace Image Export

To gain continued access to your Squarespace website images after cancelling your subscription you have several...

MySQL 8.x GRANT ALL STATEMENT

-- CREATE CREATE USER 'tgnrestoreuser'@'localhost' IDENTIFIED BY 'AppleSauceLoveBird2024'; GRANT ALL PRIVILEGES ON...

Exetel Opt-Out of CGNAT

If your port forwards and inbound and/or outbound site-to-site VPN's have failed when switching to Exetel due to their...