Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Create Registry Key Variable

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1417
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Create Registry Key Variable
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Create Registry Key Variable - 9/30/2004 6:40:35 AM   
  ytram

 

Posts: 1
Score: 0
Joined: 9/30/2004
From:
Status: offline
I am very new to VBS. I have always used batch files, and am now just trying to get into the VBS Game. I have been able to do some basic stuff using templates.

Questin is: Is there a way to create a variable based on a registry key value, and then launch a win32 app using the variable as a switch?

Any help would be great!

Thanks
 
 
Post #: 1
 
 Re: Create Registry Key Variable - 9/30/2004 7:18:18 AM   
  mbouchard


Posts: 1906
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
Yes and yes. I will put an example below, but check Here and you can get the Script documentation Here

Taken from Documentation.
quote:

Dim WshShell, bKey
Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.RegWrite "HKCU\Software\ACME\FortuneTeller\", 1, "REG_BINARY"
WshShell.RegWrite "HKCU\Software\ACME\FortuneTeller\MindReader", "Goocher!", "REG_SZ"

bKey = WshShell.RegRead("HKCU\Software\ACME\FortuneTeller\")
strRegKey = WshShell.RegRead("HKCU\Software\ACME\FortuneTeller\MindReader")
msgbox strRegKey

'Run command could be
'WshShell.Run "somefile.exe /" & strRegKey,1,TRUE

WshShell.RegDelete "HKCU\Software\ACME\FortuneTeller\MindReader"
WshShell.RegDelete "HKCU\Software\ACME\FortuneTeller\"
WshShell.RegDelete "HKCU\Software\ACME\"


Mike

(in reply to ytram)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Create Registry Key Variable Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts