Solved Batch File Failure

TechnoMage2016

Retired PC Tech
Pro User
VIP
For the past month, I've been writing batch files to remove all the temp files from a PC.
I started with Win-11, then Win-10, then Win-8.1 and all was well. The batch files worked, and all the temp folders were cleaned.

Then I tried basically the same thing with Win-7, Ultimate/x86 and a simple line to delete the temporary internet files from Firefox, fell dead, with an answer "File not Found" or something like that.
And that was with 5,110 temp files in the folder. And yes, I checked the path name, double checked it and triple checked it. No go. But when I accessed the same folder in Windows Explorer, there were the files, and I could easily delete them manually. And I did.
Other simple batch commands, like, "Del /f/s/q C:\*.tmp" work just fine.

So, being out of ideas myself, here I am. Looking for fresh ideas.

TM :cool:
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Various
OS
Win 7 Pro, SP1, x86, Win-11/Pro/64
CPU
AMD
Motherboard
Various
Memory
8GB Crucial
Graphics Card(s)
Various
Sound Card
OnBoard
Monitor(s) Displays
Acer 21.5"
Hard Drives
Crucial SSD, 500 GB
PSU
OEM
Case
SFF Slim Line Case
Cooling
OEM
Keyboard
eMachines
Mouse
Logitech Wireless
Internet Speed
varies
Antivirus
Windows Defender/Super Anti-Spyware
Browser
Firefox

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
medionl/Aspire 6930G/acer x55a
OS
W7 home premium 32bit/W7HP 64bit/w10 tp insider ring
CPU
E5300 dual core
Motherboard
medion MS7366
Memory
3gb
Graphics Card(s)
Nvidia Geforce 7100 Nforce 630i
Monitor(s) Displays
avixc
Internet Speed
n (isp resticted to 72)
Antivirus
mse/pands
Browser
palemoon
Other Info
Belkin Fd7050 n USB using Railink RT2870 drivers, more upto date
i use this 1, works on 10 as well. Download TFC

As a matter of fact, it works pretty dang well on Win-11/Pro/64 as well.
Thank You, that got rid of the Firefox Temporary Internet Files on my old eMachine running Win-7 Ultimate.
Where nothing I tried worked.

I just ran TFC here on my Win-11 PC and it did a pretty good job, and only left 1184 junk files. But, from exactly Where, I don't know.
I noticed that when it cleans out the temp files from Firefox, it also takes out the last three levels of folders as well.
Kind of like burning the barn down, to get rid of a mouse. But fear not, Firefox rebuilds those folders on the next run.

At this time, I have no way to know what other folders may have been deleted.

Since my Cleanup Batch file, is 100% effective on Win-8.1, 10 and 11 I'll reserve the use of TFC for Win-7.

Thank you sir, your assistance is very much appreciated.

Mark this topic, "Solved"
TM :cool:

- - - Updated - - -

WELL, not 100% solved!

I thought if TFC removed everything in the path to the Firefox temp files, including the directories housing them, then maybe I could to that within my batch file. I had just been trying to remove the files themselves, and not the directories housing them. Once the directories have been deleted, the temp files are gone too! VOILA! Success!

DANG, it worked! And I can continue to develop my Win7Cleanup.bat program, which does remove more files than TFC.
And I have TFC to thank for the inspiration, as well as the solution to my problem that prompted this topic.
And a big Thank You to 'Torchwood' too!

TM :cool:
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Various
OS
Win 7 Pro, SP1, x86, Win-11/Pro/64
CPU
AMD
Motherboard
Various
Memory
8GB Crucial
Graphics Card(s)
Various
Sound Card
OnBoard
Monitor(s) Displays
Acer 21.5"
Hard Drives
Crucial SSD, 500 GB
PSU
OEM
Case
SFF Slim Line Case
Cooling
OEM
Keyboard
eMachines
Mouse
Logitech Wireless
Internet Speed
varies
Antivirus
Windows Defender/Super Anti-Spyware
Browser
Firefox
Back
Top