command line to delete folder contents

Page 1 of 2 12 LastLast

  1. Posts : 60
    Win7 Ultimate x32
       #1

    command line to delete folder contents


    What line in a batch file would delete the contents of
    C:\Users\MyName\AppData\Local\Microsoft\Windows\Temporary Internet Files\ ?
    del /F /S /Q /A "C:\Users\MyName\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*" fails, so does
    del "C:\Users\MyName\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*" /q
      My Computer


  2. Posts : 1,436
    Windows 8.1 Pro x64
       #2

    Hello,

    Try:

    Code:
    DEL "C:\Users\MyName\AppData\Local\Microsoft\Windows\Temporary Internet Files\"
    Haven't coded BATCH in awhile, so not totally sure.

    -Justin
      My Computer


  3. Posts : 60
    Win7 Ultimate x32
    Thread Starter
       #3

    Thanks Justin - NO improvement
      My Computer


  4. Posts : 1,436
    Windows 8.1 Pro x64
       #4

    Okay i looked it up this time:

    Code:
    del "C:\Users\MyName\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*"
    You had a /q in there, and there is no need for it. So give that a shot, if not, then let me know.

    -Justin
      My Computer


  5. Posts : 60
    Win7 Ultimate x32
    Thread Starter
       #5

    Still no better - could it be that \Temporary Internet Files\ is more stubborn than other folders ?
      My Computer


  6. Posts : 10,485
    W7 Pro SP1 64bit
       #6

    If you open an admin cmd prompt window and type in your command - you will be told that index.dat is in use. You will even see that there are folders that will show in the cmd prompt but do not usually show in windows file explorer.
      My Computer


  7. Posts : 60
    Win7 Ultimate x32
    Thread Starter
       #7

    I am not clear what the implication is from your information. Index.dat does not show as a content item in MY TIF folder.
    It may be relevant to point out that there is NO difficulty opening that folder, selecting all the contents and deleting them. The problem arises when I try to use code to do it.
    Last edited by Sebastian42; 05 Aug 2012 at 03:54. Reason: add more information
      My Computer


  8. Posts : 10,485
    W7 Pro SP1 64bit
       #8

    The path that you are using is not a real path. It is one of the many places where Microsoft shows you info that is not really located in that folder structure. Also, there are real folders and files under the "TIF" folder that you do not normally see via the Windows file explorer. My suggestion is to not mess with them:

    command line to delete folder contents-tif.jpg
      My Computer


  9. Posts : 60
    Win7 Ultimate x32
    Thread Starter
       #9

    Thanks for that advice. My only interest in deleting the files in TIF arises from the advice I was given to do that in order to solve a problem in Windows Live Mail.
      My Computer


  10. Posts : 10,485
    W7 Pro SP1 64bit
       #10

    you can try:

    rd "C:\Users\username\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\" /q/s

    It will still fail because index.dat is in use - but the folders and and temp files should be gone.
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About 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 17:11.
Find Us