%systemroot% or %windir% for button icons?

When invoking an application via a button the use of %systemroot% or %windir% works well as an alternative to C:\WINDOWS or C:\WINNT and makes the button independent of the default structure of XP vs. W2K. The same technique does not work for button icons/images. As soon as C:\WINDOWS is replaced with %systemroot%, the icon disappears.

Is there any way around this or is it a Windows limitation?

Regards, AB

I just tried it here and %systemroot% works fine for icons. Using Vista and the latest Opus. Are you sure the icon exists in the location you're specifying?

In my case %SystemRoot% works just fine for finding and executing the application, but not for finding the icon. Sample buttons follow. In both cases, the application starts when the button is clicked. The correct icon is displayed on the 1st button. The default "Smiley Face" icon is displayed on the 2nd button. This is on an XP system.

Regards, AB

Button works, icon is correctly displayed.

<?xml version="1.0"?> diskmgmt diskmgmt C:\WINDOWS\system32\diskmgmt.msc,0 cd "C:\WINDOWS\system32" C:\WINDOWS\system32\diskmgmt.msc

Button works, icon is default "Smiley Face"

<?xml version="1.0"?> diskmgmt diskmgmt %SystemRoot%\system32\diskmgmt.msc cd %SystemRoot%\system32 %SystemRoot%\system32\diskmgmt.msc

Try with an EXE or DLL file.

Even when the button works, if you then go to edit it the icon is blank again. diskmgmt.msc seems to confuse Opus, probably because the icon isn't in the .msc file at all but is really in %systemroot%\system32\dmdskres.dll (which works fine).

The .msc file is really XML with a link in it pointing to the DLL.

Excellent! I never thought to inspect the .MSC with an editor. All makes perfect sense now (except for the use of MSC instead of XML, when that is all it is!).

Regards, AB

Also, although this may not matter (and I did not try), these two lines are not the same; check the missing ",0" in the second one.