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