How do I list files with the full path and size? "Dir /s /b" lists files with full path but no file size.
My computer is full of peculiar executable files. For every folder, there is a corresponding executable with the same name. For example, there are executables named "Program Files.exe" and "Windows.exe" in C:\ . Every such file has the exactly same size: 46620.
I am thinking of deleting them by first listing all files with full path and size then using the find command to filter off files whose size is not 46620 and name doesn't contain ".exe". The problem is I don't know how to do the first step - listing files with full path and size.
Any help will be greatly appreciated.
list files with full path and size
Moderator: DosItHelp
Re: list files with full path and size
It can be done in batch but also in Windows search.
Configure the search to search the hard drive (by default in Vista+ it only searches indexed files)
and search for *.*
Then sort the results by clicking on the size column where you can look at the files of that size.
It sounds a bit like malware...
You can also use the advanced search to find only files of that size, I think.
Configure the search to search the hard drive (by default in Vista+ it only searches indexed files)
and search for *.*
Then sort the results by clicking on the size column where you can look at the files of that size.
It sounds a bit like malware...
You can also use the advanced search to find only files of that size, I think.
Re: list files with full path and size
A simple way to get a quick list is this:
You could also use dir c:\*.exe there if you only need to locate exe files.
Code: Select all
dir c:\ /a-d /s |findstr /i /c:"c:\\" /c:" 46,620 "
You could also use dir c:\*.exe there if you only need to locate exe files.
Re: list files with full path and size
Thanks to everyone who replied to my question.
I found that the following command does what I want:
forfiles /s /M *.exe /c "cmd /c echo @path @fsize"
This command lists .exe files with their full path and size. From there I can filter off those whose size is not 46620.
I found that the following command does what I want:
forfiles /s /M *.exe /c "cmd /c echo @path @fsize"
This command lists .exe files with their full path and size. From there I can filter off those whose size is not 46620.
Re: list files with full path and size
I posted the following reply few days back but it is gone. Not sure what happened.
I found that the following command would do what I want:
forfiles /s /M *.exe /c "cmd /c echo @path @fsize"
I found that the following command would do what I want:
forfiles /s /M *.exe /c "cmd /c echo @path @fsize"
Re: list files with full path and size
Posts from new members need to be approved before they become public.yky wrote:I posted the following reply few days back but it is gone. Not sure what happened.
Re: list files with full path and size
yky wrote:
"I found that the following command does what I want:
forfiles /s /M *.exe /c "cmd /c echo @path @fsize"
This command lists .exe files with their full path and size. From there I can filter off those whose size is not 46620.
You can filter it right in one pass like this:
Code: Select all
forfiles /s /M *.exe /c "cmd /c if @fsize equ 46620 echo @path @fsize"