Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Using oShell.RegWrite if full path does not exist

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Using oShell.RegWrite if full path does not exist
  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 >>
 Using oShell.RegWrite if full path does not exist - 6/16/2008 2:41:23 AM   
  GreatBarrier86

 

Posts: 71
Score: 0
Joined: 3/10/2008
Status: offline
Hi,

If i try to use oShell.Regwrite to write to a location that doesnt exist, how can i get it to create the necessary keys and values? I want to load the default user hive, apply the settings, and unload it but the default user hive doesnt have all the necessary keys to make these changes.

Jason
 
 
Post #: 1
 
 RE: Using oShell.RegWrite if full path does not exist - 6/16/2008 3:21:22 AM   
  ebgreen


Posts: 5041
Score: 31
Joined: 7/12/2005
Status: offline
This is by no means perfect (I just keep finding other things to do instead of fixing it), but it does work for most things that I need to do. See if it will get you pointed in the right direction.


      

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to GreatBarrier86)
 
 
Post #: 2
 
 RE: Using oShell.RegWrite if full path does not exist - 6/18/2008 1:18:18 AM   
  GreatBarrier86

 

Posts: 71
Score: 0
Joined: 3/10/2008
Status: offline
Thanks! it's too bad the usual RegWrite isn't smart enough ;)

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: Using oShell.RegWrite if full path does not exist - 6/18/2008 2:08:06 PM   
  DiGiTAL.SkReAM


Posts: 1184
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Not sure what you were doing, but it seems to write to anywhere I tell it to, without complaint.
All you HAVE to make sure of is that you have the correct Root.  For example, write to a key somewhere under HKLM\SYSTEM or \SOFTWARE, etc.
This works:
oShell.RegWrite "HKLM\SYSTEM\SooperTest\NewTest\Test1","testing123","REG_SZ"

This does NOT work:
oShell.RegWrite "HKLM\SYSTEM2\SooperTest\NewTest\Test1","testing123","REG_SZ"

You can put almost anything after SYSTEM\ and it will work to create a key with that name under SYSTEM.  But you can't use regwrite to create something like HKLM\SYSTEM2 or HKLM\MYSYSTEM.


_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to GreatBarrier86)
 
 
Post #: 4
 
 RE: Using oShell.RegWrite if full path does not exist - 6/20/2008 1:50:48 AM   
  GreatBarrier86

 

Posts: 71
Score: 0
Joined: 3/10/2008
Status: offline
Oh. Well i had loaded the Default user profile...hmm...maybe my root was bad.

I might have been trying to write System2 where it shouldnt have been

< Message edited by GreatBarrier86 -- 6/20/2008 1:55:41 AM >

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 5
 
 
 
  

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 >> Using oShell.RegWrite if full path does not exist 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