Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: command line to delete folder contents

05 Aug 2012   #11

Win7 Ultimate x32

Still no obvious deletion of ANY files. I repeat that 'manually' I CAN clear the folder, but not by code (in a batch file).

My System SpecsSystem Spec

05 Aug 2012   #12

W7 Pro SP1 64bit

The only way that I know how to do it via a batch file involves messing with folder permissions... maybe someone else knows of a safer way.
My System SpecsSystem Spec
05 Aug 2012   #13

Windows 7 Ultimate x64

Quote   Quote: Originally Posted by Sebastian42 View Post
I repeat that 'manually' I CAN clear the folder, but not by code (in a batch file).
Pretty sure UsernameIssues is correct on this. If you are using Explorer to manually clean that folder I think all that's really happening is that you are cleaning files from 4 different folders that actually reside one level deeper.

If you look at that folder's contents offline (without Windows running) you'll see it only contains one file (that index.dat file) and a bunch of randomly named folders. I think 4 of those folders contain the temporary files you're deleting. The rest of those folders seem to be "decommissioned" folders containing even older temporary files.
My System SpecsSystem Spec

05 Aug 2012   #14

W7 Pro SP1 64bit

Sebastian42, I don't use a computer with W7. I have a couple of W7 virtual machines that I can play with and learn from and a few W7 computers that I support. I've used a script to clear IE's data for many years, but I don't know enough about W7 to know what needs to be changed in my script tn order to accomplish what you need.

The script calls a line like this: RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351
and then the script handles things that the "ClearMyTracksByProcess" call does not clear.

If you want to run that line inside a batch file, you may see a window popup showing you the progress of the cleanup - it depends on how many files there are to be cleaned and the speed of your computer - you might not see that window.

There are lots of web pages detailing the flags that can be used with this command.
The flag would be the 4351 part of:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351

If you do not want to see the progress window, try:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 23035

None of this clears all of the info inside DOMStore and I don't know if that DOM info is what might be causing you problems inside WLM or not. Clearing the IE data via the regular user interface can clear the DOM info. My attempts to ferret out more knowledge about the flags used with ClearMyTracksByProcess via Process Monitor has not yielded the magic flag for clearing that DOM data yet.
My System SpecsSystem Spec
05 Aug 2012   #15
Layback Bear

Windows 7 Pro. 64/SP-1

This might do what you want.
Disk Cleanup : Extended
My System SpecsSystem Spec
05 Aug 2012   #16

W7 Pro SP1 64bit

Quote   Quote: Originally Posted by Sebastian42 View Post
....I repeat that 'manually' I CAN clear the folder, but not by code (in a batch file).
Could you please post a screenshot of the files that you see before you do this manual cleanup.
My System SpecsSystem Spec

 command line to delete folder contents

Thread Tools

Similar help and support threads
Thread Forum
Folder - Delete from Command Prompt
How to Delete a Folder in Windows from the Command Prompt This will show you how to permanently delete a Folder in Vista, Windows 7, or Windows 8 using the RD or RMDIR command from within a command prompt. This can be handy if you cannot delete the folder using the normal methods. ...
Opening desktop folder from command line
I have a desktop folder that contains all of the objects related to my internet access that is arraged in a specific way. When I click on it from the desktop, the arrangement is shown propeerly. However, if I try to open it from the command line, the arrangement is lost and everything is...
General Discussion
Command Line - Help
Hi Guy's and Girls, Just first off I've never been too good with CMD and only an Apprentice in my company I work for. Now something I've wanted to do for awhile was to make the following but I don't necassirealy I know how to do this in one batch file: I would need a Batch file that is...
General Discussion
How to capture the contents of the clipboard using the command line?
There are lots of sites discussing how to redirect the output of the command line to the clipboard but nothing covering the opposite. I want to capture a link address I have copied to my clipboard and send it to a command line program, as a variable, in a script. Clip.exe seems to be the only...
How-to Open Any Folder From Command Line [cmd] ?
Example ProgramData or Any Hinden Folder. Sometime I Don't Need Check Show Hidden Files In Folder Option PS. Please Post All Command Line For Me. I Need All Command
General Discussion
Script or command to delete contents of Software Distribution folder?
Hi all. Anyone able to suggest a vbs (or command-line file) to clean out C:\Windows\Software Distribution\Download? Thanks, I'm aware of the significance (or lack of) of this folder, and I realize I could just drill down to it and manually dump the contents. I'm just looking for a more elegant...
Windows Updates & Activation

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 04:47.

Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App