我最近的文件:雞肋又容易侵犯隱私的功能,不論開過什麼見不得人的東東,該檔案的捷徑都會被收錄在這個地方。去觀察男性使用者的這個目錄可以對他的性癖有初步認識。
預設路徑
C:\Documents and Settings\<User Name>\Recent
XP:「開始」功能表右鍵->[內容]->[「開始」功能表]->[自訂]->[進階]->[最近的文件]
列出最近開啟的文件:取消勾選後,「最近的文件」項目將不會出現在「開始」功能表內
清除清單:清掉「最近的文件」中的記錄
開啟 regeidt 至
[HKEY_CURRENT_USER]→[Software]→[Microsoft]→[Windows]→[CurrentVersion]→[Policies]→[Explorer]
新增名為 NoRecentDocsMenu 的 DWORD,值為 1:隱藏上述「最近的文件」的設定區塊
新增名為 NoRecentDocsHistory 的 DWORD,值為 1:開啟過的檔案捷徑將不再收錄至「最近的文件」內
印出「最近的文件」內容
03 | #pragma comment ( lib, "shell32.lib" ) |
05 | int _tmain( int argc, _TCHAR* argv[] ){ |
06 | TCHAR path[MAX_PATH+1]; |
07 | WIN32_FIND_DATA findData; |
10 | if ( SHGetSpecialFolderPath( NULL, path, CSIDL_RECENT, FALSE ) ){ |
11 | _tprintf_s( _T( "%s\n" ), path ); |
13 | _tcscat_s( path, _T( "\\*.*" ) ); |
14 | hFind = FindFirstFile( path, &findData ); |
15 | path[_tcslen( path )-3] = 0; |
18 | _tprintf_s( _T( "%s%s\n" ), path, findData.cFileName ); |
19 | } while ( FindNextFile( hFind, &findData ) ); |
21 | if ( hFind != INVALID_HANDLE_VALUE ){ |
Output as text file in UTF-16LE: RecentList.txt
must define _UNICODE
03 | #pragma comment ( lib, "shell32.lib" ) |
05 | int _tmain( int argc, _TCHAR* argv[] ){ |
07 | _tfopen_s( &pFile, _T( "RecentList.txt" ), _T( "wb" ) ); |
09 | _tprintf_s( _T( "Cannot open file" ) ); |
15 | fwrite ( &BOM, sizeof ( WORD ), 1, pFile ); |
17 | TCHAR path[MAX_PATH+1]; |
18 | WIN32_FIND_DATA findData; |
20 | if ( SHGetSpecialFolderPath( NULL, path, CSIDL_RECENT, FALSE ) ){ |
21 | _ftprintf_s( pFile, _T( "%s\n" ), path ); |
23 | _tcscat_s( path, _T( "\\*.*" ) ); |
24 | hFind = FindFirstFile( path, &findData ); |
25 | path[_tcslen( path )-3] = 0; |
28 | _ftprintf_s( pFile, _T( "%s%s\n" ), path, findData.cFileName ); |
29 | } while ( FindNextFile( hFind, &findData ) ); |
31 | if ( hFind != INVALID_HANDLE_VALUE ){ |