Nagendra
Nagendra

Reputation: 1703

Getting Recent folders and Recent files in Windows XP

i wrote some code to get Recent folders and files in C# by using

DirectoryInfo d = new DirectoryInfo(
                          System.Environment.GetFolderPath(
                              Environment.SpecialFolder.Recent)).

It is working fine in windows 7.But it is not working in windows xp.
Because there is no folder with "C:\Users\AppData\Roaming\Microsoft\Windows\Recent" in XP. Then how to get recent files in windows xp?

Upvotes: 1

Views: 2370

Answers (2)

Codemaker2015
Codemaker2015

Reputation: 1

For getting recent file folder in Windows use the following command,

%AppData%\Microsoft\Windows\Recent\

Upvotes: 0

Daniel Hilgarth
Daniel Hilgarth

Reputation: 174299

On Windows XP, System.Environment.GetFolderPath(Environment.SpecialFolder.Recent) will not return "C:\Users\AppData\Roaming\Microsoft\Windows\Recent", it returns the correct path. In my case this is "C:\Documents and Settings\daniel.hilgarth\Recent".

Upvotes: 4

Related Questions