Holy cow, I wrote a book!
A corporate customer had a problem with their employees
accidentally deleting folders like
Videos and Pictures
and are looking for a way to restore them,
short of blowing away the entire user profile and starting over.
They found some techniques on the Internet but they don't always
work consistently or completely.
What is the recommended way of recreating these missing folders?
It turns out that the customer was asking a question that I answered
many years ago,
but looking at it from the other side.
To recreate a folder, call
SHGetFolderPath with the
fCreate = TRUE.
fCreate = TRUE
If you are targeting Windows Vista or higher,
the known-folder equivalent is calling
(There is a
CSIDL-to-KF conversion table