REG_EXPAND_SZ for 8.3 short names

1

I'm trying to solve a PATH issue and came across the REG_SZ and REG_EXPAND_SZ registry types, where REG_EXPAND_SZ must be used when using variables such as %SystemRoot% in the registry key.

My question is, should the REG_EXPAND_SZ type also be used for 8.3 short names such as C:\Progra~1?

lcam

Posted 2016-12-22T11:27:23.560

Reputation: 85

Answers

1

should the REG_EXPAND_SZ type also be used for 8.3 short names such as C:\Progra~1?

Clear no!

REG_EXPAND_SZ

A null-terminated string that contains unexpanded references to environment variables (for example, "%PATH%"). It will be a Unicode or ANSI string depending on whether you use the Unicode or ANSI functions.

You can look for "C:\Progra~1" in Registry (regedit) and will find a lot of REG_SZ entries.

duDE

Posted 2016-12-22T11:27:23.560

Reputation: 14 097

On the other hand, a special type is not needed because the short names (unlike environment variables) are expanded by the filesystem itself. – user1686 – 2016-12-22T12:38:20.070