0% found this document useful (0 votes)
5 views4 pages

Code CMD

The document provides instructions for finding all video files on a PC while excluding the 'Videos' folder, using Command Prompt and PowerShell commands. It includes methods for searching a single drive or all fixed drives and saving the results to a text file on the desktop. Additionally, it outlines how to log clipboard history and recent file activities over the last 90 days.

Uploaded by

XIYUE
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

Code CMD

The document provides instructions for finding all video files on a PC while excluding the 'Videos' folder, using Command Prompt and PowerShell commands. It includes methods for searching a single drive or all fixed drives and saving the results to a text file on the desktop. Additionally, it outlines how to log clipboard history and recent file activities over the last 90 days.

Uploaded by

XIYUE
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

═══════════════════════════════════════════════════════════

FIND ALL VIDEO FILES ON THE PC – EXCLUDING THE "VIDEOS" FOLDER

Save this as a text file or PDF and keep it handy

═══════════════════════════════════════════════════════════

▼▼▼ 1. COMMAND PROMPT ([Link]) – Single drive (C:) ▼▼▼

dir "C:\*.mp4" "C:\*.mkv" "C:\*.avi" "C:\*.mov" "C:\*.wmv" "C:\*.flv" "C:\*.webm" "C:\*.m4v" "C:\
*.mpg" "C:\*.mpeg" "C:\*.3gp" /a:-d /s /b | findstr /v /i "\\Videos\\" > "%USERPROFILE%\Desktop\
Videos_Outside_Videos_Folder.txt"

▼▼▼ 2. COMMAND PROMPT – All fixed drives automatically ▼▼▼

wmic logicaldisk where drivetype=3 get name | find ":" > [Link] && (for /f "delims=" %i in ([Link])
do @dir "%i\*.mp4" "%i\*.mkv" "%i\*.avi" "%i\*.mov" "%i\*.wmv" "%i\*.flv" "%i\*.webm" "%i\*.m4v"
"%i\*.mpg" "%i\*.mpeg" "%i\*.3gp" /a:-d /s /b 2>nul | findstr /v /i "\\Videos\\") > "%USERPROFILE%\
Desktop\Videos_Outside_Videos_Folder.txt" && del [Link]

▼▼▼ 3. POWERSHELL – Single drive (C:) ▼▼▼

Get-ChildItem -Path C:\ -Include


*.mp4,*.mkv,*.avi,*.mov,*.wmv,*.flv,*.webm,*.m4v,*.mpg,*.mpeg,*.3gp,*.ts,*.m2ts -File -Recurse -
ErrorAction SilentlyContinue |

Where-Object { $_.FullName -notmatch '\\Videos\\' } |

Select-Object -ExpandProperty FullName |

Out-File "$env:USERPROFILE\Desktop\Videos_Outside_Videos_Folder.txt" -Encoding UTF8

▼▼▼ 4. POWERSHELL – ALL drives automatically (BEST ONE) ▼▼▼

Get-PSDrive -PSProvider FileSystem | ForEach-Object {

Get-ChildItem "$($_.Root)" -Include


*.mp4,*.mkv,*.avi,*.mov,*.wmv,*.flv,*.webm,*.m4v,*.mpg,*.mpeg,*.3gp,*.ts,*.m2ts -File -Recurse -
ErrorAction SilentlyContinue
} | Where-Object { $_.FullName -notmatch '\\Videos\\' } |

Select-Object -ExpandProperty FullName |

Out-File "$env:USERPROFILE\Desktop\Videos_Outside_Videos_Folder.txt" -Encoding UTF8

Write-Host "Search complete! Check your Desktop → Videos_Outside_Videos_Folder.txt" -


ForegroundColor Cyan

═══════════════════════════════════════════════════════════

How to use:

1. Open Command Prompt or PowerShell AS ADMINISTRATOR

2. Copy-paste the version #4 (recommended)

3. Wait (can take minutes to hours depending on PC size)

4. Open the file on your Desktop when it finishes

═══════════════════════════════════════════════════════════

# === SHOW CLIPBOARD + FILE COPY/PASTE/CUT HISTORY LAST 3 MONTHS ===

$DaysBack = (Get-Date).AddDays(-90)

$LogFile = "$env:USERPROFILE\Desktop\Copy_Paste_Cut_History_Last_3_Months.txt"

"=== COPY / PASTE / CUT HISTORY – LAST 90 DAYS ===" | Out-File $LogFile -Encoding UTF8

"Generated on $(Get-Date)" | Out-File $LogFile -Append -Encoding UTF8

"====================================================" | Out-File $LogFile -Append -Encoding


UTF8
# 1. Recent Files (shows every file you copied/cut/pasted/moved in Explorer in last 3 months)

Get-ChildItem -Path $env:APPDATA"\Microsoft\Windows\Recent" -Include *.lnk -Recurse -ErrorAction


SilentlyContinue |

Where-Object { $_.LastWriteTime -ge $DaysBack } |

ForEach-Object {

(New-Object -ComObject [Link]).CreateShortcut($_.FullName).TargetPath

} | Sort-Object -Unique | Out-File $LogFile -Append -Encoding UTF8

# 2. Clipboard text history (Windows 10/11 clipboard history database)

$ClipHistory = "$env:LOCALAPPDATA\Microsoft\Windows\Clipboard"

if (Test-Path $ClipHistory) {

Get-ChildItem $ClipHistory -Recurse -File |

Where-Object { $_.LastWriteTime -ge $DaysBack } |

Select-Object LastWriteTime, @{Name="ClipboardItem";Expression={ "Clipboard entry saved at $


($_.LastWriteTime)" }} |

Out-File $LogFile -Append -Encoding UTF8

# 3. Shellbags (shows every folder you opened while copying/pasting files)

reg query "HKCU\Software\Microsoft\Windows\Shell\Bags" /s 2>$null | Out-File $LogFile -Append -


Encoding UTF8

# 4. Jump List history (automatic + custom – shows files you copied from/to)

Get-ChildItem "$env:APPDATA\Microsoft\Windows\Recent\AutomaticDestinations"," $env:APPDATA\


Microsoft\Windows\Recent\CustomDestinations" -Include *.automaticDestinations-
ms,*.customDestinations-ms -Recurse |
Where-Object { $_.LastWriteTime -ge $DaysBack } |

Select-Object FullName, LastWriteTime | Out-File $LogFile -Append -Encoding UTF8

Write-Host "Done! Check your Desktop → Copy_Paste_Cut_History_Last_3_Months.txt" -


ForegroundColor Cyan

You might also like