Members
  • Total Members: 14197
  • Latest: Levine
Stats
  • Total Posts: 43423
  • Total Topics: 16520
  • Online today: 2317
  • Online ever: 51419
  • (01. January 2010., 10:27:49)
Users Online
Users: 1
Guests: 2317
Total: 2318









Post reply

Name:
Email:
Subject:
Message icon:

Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
Second Anti-Bot trap, type or simply copy-paste below (only the red letters):www.codekids.ba:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: RuskinF
« on: 20. June 2020., 15:07:02 »

Before we look at several Windows files and folders that you can safely remove, you should know that manually deleting them isn’t the best way to go about it.

Aside from wasting time doing this yourself when you could automate the process, it’s safer to let the Disk Cleanup tool do these cleanings for you. This avoids accidentally deleting files that you need or messing with the wrong folders.

The Windows Disk Cleanup tool helps you reclaim disk space on your computer and is simple to use. You can open it by searching for Disk Cleanup in the Start Menu. Let it scan, and you’ll see several categories of files you can erase. For more options, choose Clean up system files to gain administrator permissions.
Posted by: devnullius
« on: 16. February 2020., 12:26:39 »

I had to  google a bit before I found a bat or vbs or ps1 or exe tool that could do the following:

Check the size of a folder, once that folder exceeds a maximum size, start removing the oldest files until the folder's quotum is below its maximum set size.

The solution I found was a VBS script. Copy pastas below :)

SOURCE: Go to https://stackoverflow.com/a/48162127/2792969 for a full discussion

Code: [Select]
'FROM https://stackoverflow.com/questions/48159497/windows-bat-script-to-get-directory-size-if-over-n-gb-then-delete-oldest-files-t
'2^30*1 means 1GB and 2^30*8 means 8GB. Below, you need to change that multiplier twice and both (logically) should be the same value
'to set your folder's maximum size in GB
'And of course you need to change the folder name to match your folder

Set fso = CreateObject("Scripting.FileSystemObject")
Set F = fso.GetFolder("C:\Users\User\Pictures\Microsoft")


If F.size > 2^30*4 Then
            'Comments on a stupid editor that can't handle tabs
            'Creating an in memory disconnected recordset to sort files by date
        Set rs = CreateObject("ADODB.Recordset")
        With rs
            .Fields.Append "Date", 7
            .Fields.Append "Txt", 201, 5000
            .Open

            For Each Thing in f.files
                .AddNew
                .Fields("Date").value = thing.datelastmodified
                .Fields("Txt").value = thing.path
                .UpDate
            Next
            .Sort = "Date Desc"
            Do While not .EOF
                fso.deletefile  .Fields("Txt").Value
                If f.size < 2^30*4 then Exit Do
                .MoveNext
            Loop
        End With
End If

Run it with Task Scheduler when your PC is idle (or set it on a fixed schedule). Enjoy!!

Peace!

Enter your email address to receive daily email with 'SCforum.info - Samker's Computer Forum' newest content:

Kursevi programiranja za ucenike u Sarajevu

Terms of Use | Privacy Policy | Advertising
TinyPortal 2.3.1 © 2005-2023