Results 1 to 14 of 14

Thread: Folders in Temp

  1. #1
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    East Tennessee
    Posts
    179
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Folders in Temp

    New to Win 8
    In some of my exploring i noted that I had about 20 Empty folder in the user\my name\App Data\Local\Temp
    folder all these were modified at the same time.

    Any body know why they were generated?

    Is there a setting to remove empty folders?

    BTW - why am I told that I cannot access some of the folders?

    Thanks in advance
    Win 8, Firefox 16.0.2, Thunderbird 15.0.2

  2. #2
    Plutonium Lounger Medico's Avatar
    Join Date
    Dec 2009
    Location
    USA
    Posts
    12,631
    Thanks
    161
    Thanked 936 Times in 856 Posts
    You can actually delete all items in temp folders. I do this all the time. These folders get stuff regularly. This is one reason why I regularly clean up all this temp stuff.

    Win 7 gets temp stuff quite often as well. In fact most versions do. Win 7 and now Win 8 handle all this temp stuff better than previous versions. It still is good to get rid of this stuff regularly.

    I use a batch file loaded in my Startup folder that runs when I start Windows. The following can be pasted into Notepad then saved as a .bat file to your desktop. Just run it periodically or do as I do and place it in the Startup folder so it runs once whenever you start Windows.

    Code:
    @Echo off
    cls
    
    cleanmgr /sageset:1000
    
    del /F /S /Q  "%systemroot%\temp\*.*"
    
    
    del /F /S /Q  "C:\AppData\Local\Microsoft\Windows\History\*.*"
    del /F /S /Q  "C:\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\*.*"
    del /F /S /Q  "C:\AppData\Local\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5\*.*"
    del /F /S /Q  "C:\AppData\Local\Microsoft\Windows\Temporary Internet Files\Temporary Internet Files\Content.IE5\*.*"
    del /F /S /Q  "C:\AppData\Local\Microsoft\Windows\Temporary Internet Files\Temporary Internet Files\Low\Content.IE5\*.*"
    
    del /F /S /Q  "C:\Users\%UserName%\AppData\Local\Temp\*.*"
    del /F /S /Q  "C:\Temp\*.*"
    del /F /S /Q  "C:\Users\%UserName%\AppData\Local\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5\*.*
    del /F /S /Q  "C:\Users\%UserName%\AppData\Local\Microsoft\Windows\History\*.*
    
    
    ::Rem:  No need to duplicate the following section for each registered User
    del /F /S /Q  "%homepath%\Cookies\*.*"
    del /F /S /Q  "%homepath%\recent\*.*"
    del /F /S /Q  "%homepath%\Local Settings\cookies\*.*"
    
    del /F /S /Q  "%homepath%\Local Settings\History\*.*"
    del /F /S /Q  "%homepath%\Local Settings\Temp\*.*"
    del /F /S /Q  "%homepath%\Local Settings\Temporary Internet Files\Content.IE5\*.*"
    
    
    del /F /S /Q "C:\$Recycle.Bin.Bin\*.*" 
    
    del /F /S /Q "C:\Recycled\*.*"
    
    cleanmgr /sagerun:1000
    Notice the file path you mention is included.

    Note: The sageset command at the beginning needs to be run only once. After running this once, simply delete that line.
    Last edited by Medico; 2013-04-19 at 18:31.
    BACKUP...BACKUP...BACKUP
    Have a Great Day! Ted


    Sony Vaio Laptop, 2.53 GHz Duo Core Intel CPU, 8 GB RAM, 320 GB HD
    Win 8 Pro (64 Bit), IE 10 (64 Bit)


    Complete PC Specs: By Speccy

  3. #3
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    Quote Originally Posted by halek2 View Post
    New to Win 8
    In some of my exploring i noted that I had about 20 Empty folder in the user\my name\App Data\Local\Temp
    folder all these were modified at the same time.

    Any body know why they were generated?
    Such temp files were generated in previous Windows versions, as well. The temp folder is just a working space for the running apps.
    Rui
    -------
    R4

  4. #4
    Super Moderator jwitalka's Avatar
    Join Date
    Dec 2009
    Location
    Minnesota
    Posts
    6,792
    Thanks
    117
    Thanked 798 Times in 719 Posts
    These folders are placed there by various programs for use as temporary storage. There are ways of deleting folders you are denied access to but I wouldn't do that since the program that installed it obviously doesn't want it deleted and it may be necessary for continued operation. If they are empty, they don't hurt anything.

    Jerry

  5. #5
    Bronze Lounger DrWho's Avatar
    Join Date
    Dec 2009
    Location
    Central Florida
    Posts
    1,501
    Thanks
    30
    Thanked 205 Times in 163 Posts
    I'm in lock step with 'Medico' on getting rid of the junk files on my PC and keeping them GONE with a batch file that runs daily, automatically from my Startup folder.

    The only difference is that I run Windows XP as my main OS, and I still use an old DOS command that still works in XP, that is "Deltree.exe".

    It does have to be transplanted into XP from 98 or ME.

    So my own XPCleanup.bat program starts out something like this:

    @Echo off
    cls
    deltree /y "C:\windows\temp\*.*"


    The idea here is that Deltree is a combination of two words, Delete and Tree
    because it was designed to delete an entire tree structure, beginning at the starting point (path) you type in. So, if there are any sub-folders in the 'temp' directory, they will be deleted too, as well as any files.

    For instance, the command "deltree /y C:\*.*" would wipe out an entire C drive.
    And with the /y switch employed, it would execute the command without ever stopping to ask you, "Are you sure?".
    I call it the most powerful and the most dangerous command ever written by MS. That may be why they eliminated it in Windows XP. (but, it will still run in XP, once you transplant it there)

    My cleanup batch file is almost exactly like Medico's, but mine uses the Deltree command with the /y switch instead of the Del command with it's own associated switches. Deltree will not run at all in Windows 7 or 8, so the Del command has to be used in those OS's.

    No matter what command you use, just having your own Cleanup.bat program running automatically, every day will keep your PC from ever getting totally swamped with Garbage Files.

    In my own XPCleanup.bat program, I've found that I can even empty the Recycle bin and the Quarantine folder for my AV program. Every time I find a new folder where some program is storing it's CRAP files, I add that path to my cleanup batch file.
    My own personal cleanup batch file is now about 40 lines long.

    When I'm doing a tuneup for a customer, I install a generic version of my Cleanup.bat program into the Startup folder on that PC and its Shortcut is set to run the program, 'Minimized' so it's not shown on the desktop when it runs.

    Cheers Mates! Happy Computing!

    The Doctor
    Last edited by DrWho; 2013-04-20 at 16:13.
    Experience is truly the best teacher.

    Backup! Backup! Backup! GHOST Rocks!

  6. #6
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    3,760
    Thanks
    26
    Thanked 424 Times in 338 Posts
    I just run the expanded Cleanmgr in conjunction with sagerun as a scheduled task every night. I don't startup since I don't shut down. Most of my routine maintenance, AV/AM scans are done by Task Scheduler while I sleep.
    Create a fresh drive image before making system changes, in case you need to start over!

    "The problem is not the problem. The problem is your attitude about the problem. Savvy?"—Captain Jack Sparrow "When you're troubleshooting, start with the simple and proceed to the complex."—M.O. Johns "Experience is what you get when you're looking for something else."—Sir Thomas Robert Deware.
    Unleash Windows

  7. #7
    Plutonium Lounger Medico's Avatar
    Join Date
    Dec 2009
    Location
    USA
    Posts
    12,631
    Thanks
    161
    Thanked 936 Times in 856 Posts
    The key is to set Clean Manager to the expanded format. The default is much tamer and as such does not clean everything. Since I do shut my PCs down at night, putting the batch file in the Startup folder works well for me. Each user will have to decide which will work best for them, at startup, manually or as a scheduled task. The key is to do it rather than how to do it. Just as Imaging, the key is to do it, not which app you use to do it.
    BACKUP...BACKUP...BACKUP
    Have a Great Day! Ted


    Sony Vaio Laptop, 2.53 GHz Duo Core Intel CPU, 8 GB RAM, 320 GB HD
    Win 8 Pro (64 Bit), IE 10 (64 Bit)


    Complete PC Specs: By Speccy

  8. #8
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    3,760
    Thanks
    26
    Thanked 424 Times in 338 Posts
    Quote Originally Posted by Medico View Post
    The key is to set Clean Manager to the expanded format. The default is much tamer and as such does not clean everything.
    Once the setup is made using the sageset switch, one can create a shortcut on the desktop (or pinned to the taskbar) using "C:\Windows\System32\Cleanmgr.exe /sagerun:nn" (nn being the number you assign with the sagerun switch - sagerun:nn), and name the shortcut Disk Cleanup or whatever. When run in this manner, it processes all hard drives, partitions/logical drives every time it is run.
    Create a fresh drive image before making system changes, in case you need to start over!

    "The problem is not the problem. The problem is your attitude about the problem. Savvy?"—Captain Jack Sparrow "When you're troubleshooting, start with the simple and proceed to the complex."—M.O. Johns "Experience is what you get when you're looking for something else."—Sir Thomas Robert Deware.
    Unleash Windows

  9. #9
    Plutonium Lounger Medico's Avatar
    Join Date
    Dec 2009
    Location
    USA
    Posts
    12,631
    Thanks
    161
    Thanked 936 Times in 856 Posts
    That is why in my batch file I say the sageset command only needs to be run once. This sets the clean manager to it's fullest format. Then as bbearren states just use the sagerun command. I just choose to clean up further with my batch file.

    You can add any or all the temp folders to the batch file. Just copy one of the lines and change the file path to the folder you wish to include.
    BACKUP...BACKUP...BACKUP
    Have a Great Day! Ted


    Sony Vaio Laptop, 2.53 GHz Duo Core Intel CPU, 8 GB RAM, 320 GB HD
    Win 8 Pro (64 Bit), IE 10 (64 Bit)


    Complete PC Specs: By Speccy

  10. #10
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    3,760
    Thanks
    26
    Thanked 424 Times in 338 Posts

    Tutorial for a Disk Cleanup Desktop shortcut

    Here is a tutorial for using the sageset and sagerun switches in conjuntion with C:\Windows\System32\Cleanmgr.exe to create a desktop shortcut for cleaning up most of the junk files on your PC. This was written for Windows XP but works equally well in Windows 7 and 8.
    Last edited by bbearren; 2013-04-27 at 12:36.
    Create a fresh drive image before making system changes, in case you need to start over!

    "The problem is not the problem. The problem is your attitude about the problem. Savvy?"—Captain Jack Sparrow "When you're troubleshooting, start with the simple and proceed to the complex."—M.O. Johns "Experience is what you get when you're looking for something else."—Sir Thomas Robert Deware.
    Unleash Windows

  11. #11
    Bronze Lounger DrWho's Avatar
    Join Date
    Dec 2009
    Location
    Central Florida
    Posts
    1,501
    Thanks
    30
    Thanked 205 Times in 163 Posts
    Quote Originally Posted by halek2 View Post
    New to Win 8
    In some of my exploring i noted that I had about 20 Empty folder in the user\my name\App Data\Local\Temp
    folder all these were modified at the same time.

    Anybody know why they were generated?

    Is there a setting to remove empty folders?

    BTW - why am I told that I cannot access some of the folders?

    Thanks in advance
    Every day, Windows and some kinds of Software, like Anti-Virus programs create new temp folders to hold their own temp files.
    Disk Cleanup and most aftermarket Cleanup programs will just ignore those temp files and folders, because they are still in use by the programs that made them.

    Even my own W8Cleanup.bat (batch file) cleanup program will run into the same thing, where certain folders that I might want to delete give me a "Cannot delete, in use by another program" error message.

    In a case such as this, where windows is saying "leave it alone, I'm using it!" then LEAVE IT ALONE! Comprende?
    Even if you could delete a Zero file, you would only gain 1k of space. It's definitely not worth worrying about.

    Happy Computing!
    The Doctor
    Experience is truly the best teacher.

    Backup! Backup! Backup! GHOST Rocks!

  12. #12
    Bronze Lounger DrWho's Avatar
    Join Date
    Dec 2009
    Location
    Central Florida
    Posts
    1,501
    Thanks
    30
    Thanked 205 Times in 163 Posts
    I've read so many different tutorials on just how to use the Microsoft Disk Cleanup in extended mode, my mind is buzzing.

    And some people try to make it so darn'ed complicated, when it's really so simple.

    So for the last time, I hope:

    On the desktop, right click on an open spot and then click NEW---Shortcut.
    In the topic bar on the resultant window, type in or just copy and paste in this line:

    %SystemRoot%\System32\Cmd.exe /c Cleanmgr /sageset:65535 & Cleanmgr /sagerun:65535

    Give it a name, like W8Cleanup and save it.

    The first time you run Disk Cleanup in extended mode, you will need to check the little box next to each item that you want it to clean up. I just click everything, BUT, Setup Logs. Windows needs those setup logs....leave them alone.

    After checking everything else, run the program. *
    * in extended mode, the program will clean every drive in your system, so don't leave Flash Drives, external drives, etc, plugged in if you don't want them cleaned.

    Once the program has run the first time, you need to right click on the shortcut again, click Properties and in the shortcut, edit it down to just:

    %SystemRoot%\System32\Cmd.exe /c Cleanmgr /sagerun:65535

    This removes 'sageset' because it's no longer needed. From now on the program will run without any user intervention and can even be run automatically, from your Startup folder.

    I do that, for my customers who basically REFUSE to do anything for themselves. It does help to keep a PC clean of the daily crap.

    Cheers Mates!
    The Doctor
    Experience is truly the best teacher.

    Backup! Backup! Backup! GHOST Rocks!

  13. #13
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    3,760
    Thanks
    26
    Thanked 424 Times in 338 Posts
    Quote Originally Posted by DrWho View Post

    %SystemRoot%\System32\Cmd.exe /c Cleanmgr /sageset:65535 & Cleanmgr /sagerun:65535
    That exact line in quotes gets 219 hits in Google. It's the "65535" that tickles me. In the early days of XP, users seemed to think that there was something magical about that specific number, as if it were a special GUID. And "Cmd.exe" isn't really necessary, either.

    I just use sageset:01. It brings up exactly the same menu. From the run (or search) box, one can just type "cleanmgr /sageset:01" and hit enter. That envokes the extended options box. Check the boxes desired, and then OK. It's in the tutorial I linked in post #10.
    Create a fresh drive image before making system changes, in case you need to start over!

    "The problem is not the problem. The problem is your attitude about the problem. Savvy?"—Captain Jack Sparrow "When you're troubleshooting, start with the simple and proceed to the complex."—M.O. Johns "Experience is what you get when you're looking for something else."—Sir Thomas Robert Deware.
    Unleash Windows

  14. #14
    2 Star Lounger
    Join Date
    Apr 2013
    Posts
    103
    Thanks
    9
    Thanked 10 Times in 9 Posts
    The reason you cannot access some of those folders is because those aren't really folders. They are a special kind of shortcut file that Windows requires to keep compatibility with older software.

    On earlier versions of Windows the folder structure was much different. My Documents was a separate folder, with My Music/My Pictures/etc within it.

    On 7 and 8, you now have Documents. My Documents is within that folder. My Music is not. How to keep the files going where Windows wants them, but still keep the software working 100%? Link the old location to the new real location.

    If you turn on "Hide protected operating system files", they should disappear from your screen.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •