I am seeing the same results with this command. You could argue that this
is a documentation problem - but I won't make that arguement

The command
reference should really be
11, [ErrorMode], hKey, [ExpandMode], Key, [ExpandMode], ValueName, Type,
[Size,] Value
A size parameter is only needed for DAREG_NONE, DAREG_BINARY, DAREG_LINK,
DAREG_RESOURCE_LIST, DAREG_MULTI_SZ. For value types that do not require a
size - you should leave out the parameter entirely. DUA will look at the
type and based on this information determine if the next parameter should be
the size or the value. In the command you included DUA sees that the type
is REGSZ and expects the next parameter to be the value. Since the next
value is specified as a null string - DUA assumes this is the value you want
to set and moves on (this is why the command shows as a success). It
ignores anything beyond the last parameter. The real bug is that we should
catch this when you compile your script.
So you will find that this command sets an empty string:
REGSETVALUE,,HKEY_LOCAL_MACHINE,,SYSTEM\CurrentControlSet\SampleKey,,SampleV
alue,DAREG_SZ,,Hello World
Whereas this command actually sets the value:
REGSETVALUE,,HKEY_LOCAL_MACHINE,,SYSTEM\CurrentControlSet\SampleKey,,SampleV
alue,DAREG_SZ,Hello World
Sorry for the confusion.
- John
This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter" <@> wrote in message news:(E-Mail Removed)...
> Hi
>
> Could someone please help on this issue, please
>
> I have the same issue as Mario, and tried alot of things but the value is
> never set :-(
>
> /Peter
>
> "Mario Dambauer" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > hi all, I posted this weeks ago, no response, I hope someone can help
> me...
> > John Macintyre, hope you will read this post !!! ;-))
> >
> > I can create Keys in the reg, but when I want to set a value, there is a
> > problem.
> > The value is created, but is NOT set!
> >
> > I have tried several times, but always the same result.
> > Here is the sample script from the msdn - doesn't work!
> >
> > REGCREATEKEY,, HKEY_LOCAL_MACHINE ,, SYSTEM\CurrentControlSet\SampleKey
,
> > DAREG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS
> >
> >
>
REGSETVALUE,,HKEY_LOCAL_MACHINE,,SYSTEM\CurrentControlSet\SampleKey,,SampleV
> > alue,DAREG_SZ,,Hello World
> >
> >
> > I have activated the DUA Logging, it reports:
> > DUAgent Service - Command: 9 Succeded.
> > DUAgent Service - Command: 11 Succeded.
> >
> > I have really no idea whats the problem, any help would be fine!
> > Thanks in advance.
> >
> > Mario
> >
> >
>
>