Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- On Windows XP, I have set an AT job to run this command daily in C:\
- dir /s /b * > dirlist.txt
- This lists the full path of all files on the C drive. Then whenever I need to find a file, I can use findstr. This beats using Windows Explorer Search since it allows regular expression matching on the entire path. For example:
- findstr ".jpg" dirlist.txt
- findstr /i /r "windows.*system32.*png$" dirlist.txt
- This is a very fast solution to set up, and great if you find yourself with a fresh Windows install and no internet connection.
- If you need to search within certain file types for some pattern, first list all of the files you need to check, then search within them. For example, to find a Java or Python program that flips an image you could do this:
- findstr "\.java \.py" dirlist.txt > narrowlist.txt
- findstr /i /r /f:narrowlist.txt "flip.*image"
Advertisement
Add Comment
Please, Sign In to add comment