Hack Forums
[Shell] Searching for .exe-files and save result - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] Searching for .exe-files and save result (/showthread.php?tid=5554852)



Searching for .exe-files and save result - Mαxim - Feb 18, 2017

Thanks for stopping by,

I need help with a command in CMD, hopefully, someone will be able to help me and that is appreciated.

[?] I need to search for all .exe files in a particular folder in C:\ and then save the result as a .txt - Is this possible to do with one command line? Yes, it must be one command and done in CMD.


* - Mr. Monkey - Feb 18, 2017

This command:
dir /S "C:\Users\User\*.exe" > "C:\Users\User\result.txt"

Will search all exe files in "C:\Users\User\" and will search also in the sub folders (the '/S' flag) and will redirect the output to this ""C:\Users\User\result.txt" file.

Have fun.


* - Mαxim - Feb 18, 2017

(Feb 18, 2017 04:34 PM)Mr. Monkey Wrote:  This command:
dir /S "C:\Users\User\*.exe" > "C:\Users\User\result.txt"

Will search all exe files in "C:\Users\User\" and will search also in the sub folders (the '/S' flag) and will redirect the output to this ""C:\Users\User\result.txt" file.

Have fun.

Works perfect, thank you. I appreciate your help.


* - Mαxim - Feb 20, 2017

Ran into a new problem; so I want to list what's in a folder, how do I pause between each frame? If that makes any sense.

Can word it better if needed. It is from a written instruction.


* - Hackoo - Feb 20, 2017

(Feb 20, 2017 09:29 AM)Mαxim Wrote:  Ran into a new problem; so I want to list what's in a folder, how do I pause between each frame? If that makes any sense.

Can word it better if needed. It is from a written instruction.

Did you mean you want to show with a whole path ?


* - Mαxim - Feb 20, 2017

(Feb 20, 2017 10:36 AM)Hackoo Wrote:  Did you mean you want to show with a whole path ?

The question is worded real bad, then I have to translate it into English.

If you write the command "tree" in C:\ for example, how do you make it show one "screen" at the time?

Edit: tree c:\ /f | more worked

Thanks