Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


change registry value

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> change registry value
  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 >>
 change registry value - 6/8/2006 8:47:11 AM   
  brizzle

 

Posts: 11
Score: 0
Joined: 6/7/2006
Status: offline
Hi guys.  I am trying to write a script to change this value in the registry:

HKEY_USERS\.DEFAULT\Control Panel\Keyboard\InitialKeyboardIndicators

I am trying to change the InitialKeyboardIndicators value from 0 to 2 (it automatically turns the num lock key on when the computer boots up).
Anybody want to tackle it? Thanks!
 
 
Post #: 1
 
 RE: change registry value - 6/8/2006 9:02:23 AM   
  mikeock


Posts: 124
Score: 1
Joined: 6/8/2006
Status: offline
set Wshshell = Wscript.CreateObject("Wscript.Shell")
wshshell.RegWrite "HKEY_USERS\.DEFAULT\Control Panel\Keyboard\InitialKeyboardIndicators" , 2, "REG_SZ"

_____________________________

My sig sucks!

(in reply to brizzle)
 
 
Post #: 2
 
 RE: change registry value - 6/8/2006 9:08:01 AM   
  brizzle

 

Posts: 11
Score: 0
Joined: 6/7/2006
Status: offline
Beautiful I tell you! Beautiful!

(in reply to brizzle)
 
 
Post #: 3
 
 RE: change registry value - 6/8/2006 9:18:46 AM   
  mikeock


Posts: 124
Score: 1
Joined: 6/8/2006
Status: offline
you could do one even better!

read the key first

KeyVal = wshshell.RegRead("HKEY_USERS\.DEFAULT\Control Panel\Keyboard\InitialKeyboardIndicators")

if Keyval <> 2 then
   wshshell.RegWrite "HKEY_USERS\.DEFAULT\Control Panel\Keyboard\InitialKeyboardIndicators" , 2, "REG_SZ"
end if


This way you only write the ky if it hasn't been changed already

_____________________________

My sig sucks!

(in reply to brizzle)
 
 
Post #: 4
 
 RE: change registry value - 6/8/2006 11:42:29 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Please remember to search the forum, there is a post only hours older than yours, with the same subject already posted.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to brizzle)
 
 
Post #: 5
 
 RE: change registry value - 6/9/2006 12:07:04 AM   
  brizzle

 

Posts: 11
Score: 0
Joined: 6/7/2006
Status: offline
Thanks Mike.  I did look over other posts to check it out.  I wouldn't have posted if I had found something to meet my needs.  Thanks!

(in reply to brizzle)
 
 
Post #: 6
 
 
 
  

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 >> change registry value 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