regwrite command control problem
  Home FAQ Contact Sign in
microsoft.public.scripting.wsh only
 
Advanced search
POPULAR GROUPS

more...

microsoft.public.scripting.wsh Profile…
 Up
regwrite command control problem         


Author: firewalker82
Date: Jun 5, 2008 07:49

Hi,

Quick question for somebody to answer if possible. I am running a couple of
commands using vbscript and Implementing the wscript.shell framework. I have
managed to control a 'wscript.shell.exec' program call command by using the
following elements and it works a treat as it ensures that it completes
before moving to the next (how simple!!);

set oexec = wshshell.Exec(execcommand)
do while oexec.status =0
wscript.sleep(1000)
Loop

However I have the following 'wscript.shell.regwrite' command that I am
trying to control also;

regloc = """HKCU\Software\Microsoft\Synctoy\FirsttimeUser"", ""1"",
""REG_DWORD"""
set oexecreg = wshshell.RegWrite(regloc)
Do while oexecreg.status =0
wscript.sleep(1000)
Loop
Show full article (0.91Kb)
3 Comments
Re: regwrite command control problem         


Author: Allan
Date: Jun 5, 2008 08:20

Change your regloc line to this:
regloc = "HKCU\Software\Microsoft\Synctoy\FirsttimeUser", 1, "REG_DWORD"

I think you have it right, just don't put "s around your 1, putting the 1 in
"s makes the value you are putting a string, not a integer like DWORD wants.

Allan

"firewalker82" discussions.microsoft.com> wrote in message
news:3F887B6E-58D4-4E13-A25A-DFD0187D0D03@microsoft.com...
> Hi,
>
> Quick question for somebody to answer if possible. I am running...
Show full article (1.37Kb)
no comments
Re: regwrite command control problem         


Author: Paul Randall
Date: Jun 5, 2008 09:19

"firewalker82" discussions.microsoft.com> wrote in
message news:3F887B6E-58D4-4E13-A25A-DFD0187D0D03@microsoft.com...
> Hi,
>
> Quick question for somebody to answer if possible. I am running a
> couple of
> commands using vbscript and Implementing the wscript.shell
> framework. I have
> managed to control a 'wscript.shell.exec' program call command by
> using the
> following elements and it works a treat as it ensures that it
> completes
> before moving to the next (how simple!!);
>
> set oexec = wshshell.Exec(execcommand)
> do while oexec.status =0
> wscript.sleep(1000)
> Loop
>
> However I have the following 'wscript.shell.regwrite' command that I ...
Show full article (1.52Kb)
no comments
Re: regwrite command control problem         


Author: Firewalker82
Date: Jun 6, 2008 00:30

Thanks Allan,

That worked a treat! I have found that with vbscript, you have to be very
accurate with the placement of "s. Lesson learned,

Thanks once again,

--
Firewalker82

"Allan" wrote:
> Change your regloc line to this:
> regloc = "HKCU\Software\Microsoft\Synctoy\FirsttimeUser", 1, "REG_DWORD"
>
> I think you have it right, just don't put "s around your 1, putting the 1 in
> "s makes...
Show full article (1.66Kb)
no comments