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

J

Jeremy

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.
 
A

Alexander Suhovey

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top