Found a bug when adding a custom ADM template to a GPO

jeremy

Distinguished
Dec 31, 2007
445
0
18,780
Archived from groups: microsoft.public.win2000.group_policy (More info?)

Hi,

I have found an issue adding an ADM to a GPO via the GPMC, or simply
via AD Users and Computers.

Here is a section of the Custom ADM I've written for UltimateZip.

POLICY "UltimateZip Open Command"
KEYNAME "SOFTWARE\Classes\UltimateZip\Shell\Open\Command"
PART "UltimateZip Association" EDITTEXT
VALUENAME ""
DEFAULT "C:\PROGRA~1\ULTIMA~1.7\uzip.exe "%1""
END PART
END POLICY

The line DEFAULT "C:\PROGRA~1\ULTIMA~1.7\uzip.exe "%1"" errors when
the template is added. This is due to the two lots of double quotes.
If you leave the quotes off from around the %1 section, the template
is added without any errors.
i.e. DEFAULT "C:\PROGRA~1\ULTIMA~1.7\uzip.exe %1".

The strange this is that when you actually go in and edit the policy
once it's part of the GPO, you can add the quotes around the %1
section and it updates without errors and works correctly.

You need quotes around the %1 simply because it's an expanding
variable.

So obviously the code that verifies/validates the template when added
to the GPO cannot cater for the double quotes in the correct order. In
other words, it should use the outer quotes to capture the whole
string and include the inner quotes as part of the string.

It's accepting the string as "C:\PROGRA~1\ULTIMA~1.7\uzip.exe ", and
the giving an error when processing the %1"" part.

This is clearly a fault with the verification/validation process when
the template is added to the GPO.

Has anyone else experienced this, found a workaround, or can confirm
that this is a bug?

Cheers,
Jeremy.
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.group_policy (More info?)

Define string variable and use it instead:

POLICY "UltimateZip Open Command"
KEYNAME "SOFTWARE\Classes\UltimateZip\Shell\Open\Command"
PART "UltimateZip Association" EDITTEXT
VALUENAME ""
DEFAULT !!UZCOMMAND
END PART
END POLICY

<rest of adm file here>

[strings]
<some other strings>
UZCOMMAND = C:\PROGRA~1\ULTIMA~1.7\uzip.exe "%1"


hth,
Al


"Jeremy" <jeremyts@hotmail.com> wrote in message
news:ede0a130.0407290819.32b6f9ca@posting.google.com...
> Hi,
>
> I have found an issue adding an ADM to a GPO via the GPMC, or simply
> via AD Users and Computers.
>
> Here is a section of the Custom ADM I've written for UltimateZip.
>
> POLICY "UltimateZip Open Command"
> KEYNAME "SOFTWARE\Classes\UltimateZip\Shell\Open\Command"
> PART "UltimateZip Association" EDITTEXT
> VALUENAME ""
> DEFAULT "C:\PROGRA~1\ULTIMA~1.7\uzip.exe "%1""
> END PART
> END POLICY
>
> The line DEFAULT "C:\PROGRA~1\ULTIMA~1.7\uzip.exe "%1"" errors when
> the template is added. This is due to the two lots of double quotes.
> If you leave the quotes off from around the %1 section, the template
> is added without any errors.
> i.e. DEFAULT "C:\PROGRA~1\ULTIMA~1.7\uzip.exe %1".
>
> The strange this is that when you actually go in and edit the policy
> once it's part of the GPO, you can add the quotes around the %1
> section and it updates without errors and works correctly.
>
> You need quotes around the %1 simply because it's an expanding
> variable.
>
> So obviously the code that verifies/validates the template when added
> to the GPO cannot cater for the double quotes in the correct order. In
> other words, it should use the outer quotes to capture the whole
> string and include the inner quotes as part of the string.
>
> It's accepting the string as "C:\PROGRA~1\ULTIMA~1.7\uzip.exe ", and
> the giving an error when processing the %1"" part.
>
> This is clearly a fault with the verification/validation process when
> the template is added to the GPO.
>
> Has anyone else experienced this, found a workaround, or can confirm
> that this is a bug?
>
> Cheers,
> Jeremy.