I am trying to get a batch code to print the just the Date Modified, and Name of each file (more properties are ok, I just need those two) in the "Recent Items" folder. I have tried a few codes but sadly it will not work, any direction would be greatly appreciated.
Batch code that will print a list of what is inside the "Recent Items" folder
167 Views Asked by AudioBubble At
2
There are 2 best solutions below
0
On
Taking regard to all chat-like discussion:
1. To get "recent" folder:
`For /F "tokens=1,2*" %%G in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v recent ^|Find /I "recent"') do @echo G="%%G" H="%%H" I="%%I"`
and then you could replace that @echo G="%%G" H="%%H" I="%%I" with set "recentfldr=%%I" and continue with dir "%recentfldr%\" etc.
2. To wait until dir command ends (add switches for dir ad libitum but note escaped redirecting operator ^>):
start "" /wait cmd /C dir /s "%recentfldr%\" ^> "%temp%\afile.txt"
3. To send a text file to default printer:
%SystemRoot%\system32\NOTEPAD.EXE /p "%temp%\afile.txt"
Good luck!
Recent items is located here:
%userprofile%\Appdata\Roaming\Microsoft\Windows\RecentBut it contains only links (
.lnkfiles ) to the recent opened items. SoWill list them but it will be hard to distinguish files form directories.
Here's how you can get more info with WMIC query (could be slow):