Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - values

Reply
 
Old 08-19-2008   #1 (permalink)
PaulR


 
 

values

Ok, if I have a main key like:
HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
I wanted to write 10 values under the one key like:
NoBands
NoMoving
CloseDragBands"
NoSetbar
NoTools
NoSave
NoToolbarsOnTaskbar
NoTaskbar

Would I have to keep writing the main key every time I added a values like:

HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer "values"
HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer "values"
Or is there an easy way.




My System SpecsSystem Spec
Old 08-20-2008   #2 (permalink)
mayayana


 
 

Re: values

You mean the WScript.Shell RegWrite method?
You have to use the full path each time. Otherwise
how would the function know where to write?
There's no 2-stage option that would allow you
to do something like set the key as an object and
then write to it.
But you can make it more efficient by putting
the whole thing into a sub, so that you can just
do something like:

WriteAnotherValue "NoBands", 1, "REG_DWORD"

(WriteAnotherValue would then be a sub that combines
your parameters with the full path and writes the value.)

Or you can use a variable:

sPath = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"

With that you can use:

Obj.RegWrite sPath & "NoBands", 1, "REG_DWORD"
Obj.RegWrite sPath & "NoMoving", 1, "REG_DWORD"

etc.
Quote:

> Ok, if I have a main key like:
> HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
> I wanted to write 10 values under the one key like:
> NoBands
> NoMoving
> CloseDragBands"
> NoSetbar
> NoTools
> NoSave
> NoToolbarsOnTaskbar
> NoTaskbar
>
> Would I have to keep writing the main key every time I added a values
like:
Quote:

>
> HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer "values"
> HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer "values"
> Or is there an easy way.
>
>
>

My System SpecsSystem Spec
Old 08-20-2008   #3 (permalink)
PaulR


 
 

Re: values

That's about right, I will give it a try.



"mayayana" <mayaXXyana@xxxxxx> wrote in message
news:uczGD6sAJHA.3756@xxxxxx
Quote:

> You mean the WScript.Shell RegWrite method?
> You have to use the full path each time. Otherwise
> how would the function know where to write?
> There's no 2-stage option that would allow you
> to do something like set the key as an object and
> then write to it.
> But you can make it more efficient by putting
> the whole thing into a sub, so that you can just
> do something like:
>
> WriteAnotherValue "NoBands", 1, "REG_DWORD"
>
> (WriteAnotherValue would then be a sub that combines
> your parameters with the full path and writes the value.)
>
> Or you can use a variable:
>
> sPath =
> "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"
>
> With that you can use:
>
> Obj.RegWrite sPath & "NoBands", 1, "REG_DWORD"
> Obj.RegWrite sPath & "NoMoving", 1, "REG_DWORD"
>
> etc.
>
Quote:

>> Ok, if I have a main key like:
>> HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
>> I wanted to write 10 values under the one key like:
>> NoBands
>> NoMoving
>> CloseDragBands"
>> NoSetbar
>> NoTools
>> NoSave
>> NoToolbarsOnTaskbar
>> NoTaskbar
>>
>> Would I have to keep writing the main key every time I added a values
> like:
Quote:

>>
>> HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
>> "values"
>> HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer "values"
>> Or is there an easy way.
>>
>>
>>
>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Lookup values PowerShell
Compare values PowerShell
Re: how to change xml values PowerShell
need some registry values Vista General
Tip: CRC and MD5 values for Vista Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46