Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Removes the decoration from a path string.
void PathUndecorateW(
[in, out] LPWSTR pszPath
);
[in, out] pszPath
Type: LPTSTR
A null-terminated string of length MAX_PATH that contains the path. When the function returns, pszPath points to the undecorated string.
None
A decoration consists of a pair of square brackets with one or more digits in between, inserted immediately after the base name and before the file name extension.
The following table illustrates how strings are modified by PathUndecorate.
Initial String | Undecorated String |
---|---|
C:\Path\File[5].txt | C:\Path\File.txt |
C:\Path\File[12] | C:\Path\File |
C:\Path\File.txt | C:\Path\File.txt |
C:\Path\[3].txt | C:\Path\[3].txt |
Note
The shlwapi.h header defines PathUndecorate as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional, Windows XP [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | shlwapi.h |
Library | Shlwapi.lib |
DLL | Shlwapi.dll (version 5.0 or later) |
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today