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 - RegWrite Syntax

Reply
 
Old 09-14-2008   #1 (permalink)
Hal


 
 

RegWrite Syntax

I need to know the syntax for RegWrite so I can correct the script below.

All help is greatly appreciated.

Hal

**** The Script ****

DIM BitState
Set WshShell = CreateObject("WScript.Shell")

BitState = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MTU
Friedrichshafen\DIASYS\Settings\bTBRecSave")

If BitState = 1 Then
WScript.echo "Diasys Recording is On"
ElseIf BitState = 0 Then
WScript.echo "Diasys Recording is Off"
Else
WScript.echo "BitState Value of " & BitState & " Invalid"
BitState = 0
WshShell.RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\MTU
Friedrichshafen\DIASYS\Settings\bTBRecSave=dword:00000000)
WScript.echo "BitState Value Set to " & BitState
End If

My System SpecsSystem Spec
Old 09-14-2008   #2 (permalink)
Pegasus \(MVP\)


 
 

Re: RegWrite Syntax


"Hal" <Hal@xxxxxx> wrote in message
news:2F95C5F1-3235-40EE-A4A1-6F7C39DC22B4@xxxxxx
Quote:

>I need to know the syntax for RegWrite so I can correct the script below.
>
> All help is greatly appreciated.
>
> Hal
>
> **** The Script ****
>
> DIM BitState
> Set WshShell = CreateObject("WScript.Shell")
>
> BitState = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MTU
> Friedrichshafen\DIASYS\Settings\bTBRecSave")
>
> If BitState = 1 Then
> WScript.echo "Diasys Recording is On"
> ElseIf BitState = 0 Then
> WScript.echo "Diasys Recording is Off"
> Else
> WScript.echo "BitState Value of " & BitState & " Invalid"
> BitState = 0
> WshShell.RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\MTU
> Friedrichshafen\DIASYS\Settings\bTBRecSave=dword:00000000)
> WScript.echo "BitState Value Set to " & BitState
> End If
Download a copy of script56.chm from the Microsoft site. It includes a full
explanation of the sytax for the RegWrite method and there are also several
examples.


My System SpecsSystem Spec
Old 09-15-2008   #3 (permalink)
Tom Lavedas


 
 

Re: RegWrite Syntax

On Sep 14, 1:19*pm, "Pegasus \(MVP\)" <I....@xxxxxx> wrote:
Quote:

> "Hal" <H...@xxxxxx> wrote in message
>
> news:2F95C5F1-3235-40EE-A4A1-6F7C39DC22B4@xxxxxx
>
>
>
Quote:

> >I need to know the syntax for RegWrite so I can correct the script below..
>
Quote:

> > All help is greatly appreciated.
>
Quote:

> > Hal
>
Quote:

> > **** The Script ****
>
Quote:

> > DIM BitState
> > Set WshShell = CreateObject("WScript.Shell")
>
Quote:

> > BitState = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MTU
> > Friedrichshafen\DIASYS\Settings\bTBRecSave")
>
Quote:

> > If BitState = 1 Then
> > *WScript.echo "Diasys Recording is On"
> > ElseIf BitState = 0 Then
> > *WScript.echo "Diasys Recording is Off"
> > Else
> > *WScript.echo "BitState Value of " & BitState & " Invalid"
> > *BitState = 0
> > *WshShell.RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\MTU
> > Friedrichshafen\DIASYS\Settings\bTBRecSave=dword:00000000)
> > *WScript.echo "BitState Value Set to " & BitState
> > End If
>
> Download a copy of script56.chm from the Microsoft site. It includes a full
> explanation of the syntax for the RegWrite method and there are also several
> examples.
WSH 5.6 documentation download (URL all one line)
http://www.microsoft.com/downloads/d...displaylang=en

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Set empty default registry key value using regwrite ? VB Script
Generic Interface syntax in VS 2005 using Old syntax .NET General
Help with syntax PowerShell
"invalid STORE command syntax invalid message set syntax" Vista mail
need syntax Vista hardware & devices


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