For several years, I have been using the following commands (2) to count the files on my C: drive, before and after I delete temp and other junk files.
Sometimes, the difference between the two file counts, does not equal the number of files I actually see being deleted. So I can only conclude that the file counters are not actually counting ALL the files on the HD. Some files are missing! ??? Maybe some of the very files I want to delete.
Here are the two lines of code that do the file counting.
First Count, Before Cleaning:
for /f "delims=" %%A in ( ' dir /a /s "C:\" ^| find /c /v "" ' ) do set Count1=%%A
Second Count, After Cleaning:
for /f "delims=" %%A in ( ' dir /a /s "C:\" ^| find /c /v "" ' ) do set Count2=%%A
Then at the end of the program, Count 2 is deducted from Count 1 and the difference is printed as "Files Deleted".
So my question: Can these commands be revised to that they will indeed count every file on the PC's Hard Drive. ( the C: partition)
Or, do I need an entirely new command, possibly in "Power Shell" ?
Thank you for your consideration.
TechnoMage
Sometimes, the difference between the two file counts, does not equal the number of files I actually see being deleted. So I can only conclude that the file counters are not actually counting ALL the files on the HD. Some files are missing! ??? Maybe some of the very files I want to delete.
Here are the two lines of code that do the file counting.
First Count, Before Cleaning:
for /f "delims=" %%A in ( ' dir /a /s "C:\" ^| find /c /v "" ' ) do set Count1=%%A
Second Count, After Cleaning:
for /f "delims=" %%A in ( ' dir /a /s "C:\" ^| find /c /v "" ' ) do set Count2=%%A
Then at the end of the program, Count 2 is deducted from Count 1 and the difference is printed as "Files Deleted".
So my question: Can these commands be revised to that they will indeed count every file on the PC's Hard Drive. ( the C: partition)
Or, do I need an entirely new command, possibly in "Power Shell" ?
Thank you for your consideration.
TechnoMage
My Computer
System One
-
- OS
- Win-11/Pro/64
- Computer type
- PC/Desktop
- Manufacturer/Model
- Acer AX1200
- CPU
- AMD 2 Core/Athlon/64
- Motherboard
- Acer/AMD
- Memory
- Crucial, 4GB
- Graphics Card(s)
- Onboard
- Sound Card
- Onboard
- Monitor(s) Displays
- 24" Acer
- Hard Drives
- Crucial SSD 500GB
- PSU
- non OEM
- Case
- SFF Slimline
- Cooling
- OEM
- Keyboard
- eMachine, 101 key External
- Mouse
- Logitech USB Wireless
- Internet Speed
- varies
- Browser
- Firefox
- Antivirus
- Windows Defender, Super Anti Spyware
- Other Info
-
Given to me as DEAD, and irreparable.
I refurbished it, with a new SSD and max ram, and it's running Win-8.1 today.