NO

Author Topic: A very small CCleaner  (Read 1329 times)

Jokaste

  • Guest
A very small CCleaner
« on: May 08, 2019, 02:59:00 AM »
This program explains how to use SHGetKnownFolderPath.
It runs under Windows 10. Could run under Windows 7 & 8 but that's all.

Code: [Select]
LPSTR GetSpecialFolder(REFKNOWNFOLDERID rfid,LPSTR __lpszResult)
{
LPWSTR _lpwszPath = NULL ;

HRESULT _hr = SHGetKnownFolderPath(rfid,KF_FLAG_CREATE,NULL,&_lpwszPath) ;
if(SUCCEEDED(_hr))
{
WideCharToMultiByte(CP_UTF8,0,_lpwszPath,lstrlenW(_lpwszPath),__lpszResult,MAX_PATH,NULL,NULL) ;

return (__lpszResult) ;
}

return (NULL) ;
}

It cleans many folders :
  • Internet cache
  • History
  • CD Burning cache
  • Cookies
  • Printers cache
  • Recents Documents
  • Applications updates
  • Downloaded files
  • Searches
  • Searches history
  • Downloaded Program Files
  • Prefetch
  • Software Distribution
It empties all recyclebins
Launches Dism.exe to clean WinSxS

You must run the program wih Administrator privileges.
« Last Edit: May 08, 2019, 03:18:34 AM by Jokaste »