:::RHMT::: Real Home Made Turbo

General Category => General Discussion => Topic started by: BoostedSchemes on October 23, 2009, 09:11:20 PM

Title: Need to delete folders from HDD based on rule...
Post by: BoostedSchemes on October 23, 2009, 09:11:20 PM
Need to removed all the folders from f:\MP3 that have <2mb in them... manual = impossible, 15,000+ folders  :-\

any pos free software to do this for me or suggestions on a batch file? fucking hate windows 7 for being so sweet yet not allowing folder attribute sort...
Title: Re: Need to delete folders from HDD based on rule...
Post by: jagojon3 on October 23, 2009, 09:54:16 PM
I know it's possible, just not sure what program to use.

If nobody here knows, ask here

http://slickdeals.net/forums/forumdisplay.php?f=17 (http://slickdeals.net/forums/forumdisplay.php?f=17)
Title: Re: Need to delete folders from HDD based on rule...
Post by: buk9tp on October 23, 2009, 10:22:05 PM
there was a windows browser which was an alternative to windows explorer i used it before.. been looking for it but i cant find it..

it had a million ways to sort folders.. last accessed.. number of files.. size of files.. etc etc etc
Title: Re: Need to delete folders from HDD based on rule...
Post by: buk9tp on October 23, 2009, 10:23:19 PM
sort files by size

jump to the middle where the split is

delete the whole lot

FAIL
Title: Re: Need to delete folders from HDD based on rule...
Post by: BoostedSchemes on October 23, 2009, 10:30:57 PM
i can write something in vb for it but we live in an age where coding your own is much harder than requesting a link to someone who has already done it

Title: Re: Need to delete folders from HDD based on rule...
Post by: crttaz on October 23, 2009, 10:35:45 PM
Sort by size, delete in batches.
Title: Re: Need to delete folders from HDD based on rule...
Post by: jagojon3 on October 23, 2009, 10:40:07 PM
How are you going to sort folders by size?
Title: Re: Need to delete folders from HDD based on rule...
Post by: buk9tp on October 23, 2009, 10:47:42 PM
http://www.se-soft.com/ (http://www.se-soft.com/)
Title: Re: Need to delete folders from HDD based on rule...
Post by: BoostedSchemes on October 23, 2009, 10:55:16 PM
looks like buk wins  :D
Title: Re: Need to delete folders from HDD based on rule...
Post by: buk9tp on October 23, 2009, 10:57:08 PM
looks like buk wins  :D

this isnt the same one i used but the point is almost any windows explorer alternative works great..

this one is gay and wont let you delete more than one folder at a time and you cant even select more than one folder at a time nor can you drag and drop folders into one another to delete them once they are in one folder..

gay gay gay

im trying to find the other one but yeah i installed this one and used it before i posted it
Title: Re: Need to delete folders from HDD based on rule...
Post by: Kain on October 23, 2009, 11:09:48 PM
if im not mistaken, windows 7 includes the power shell. the powershell has options that are basically like linux.

so.... way beyond your ability homie.
Title: Re: Need to delete folders from HDD based on rule...
Post by: BoostedSchemes on October 23, 2009, 11:17:59 PM
thats cute i have a laptop strictly for faggot worthless midget usage thats been linux only for about 5 years

its a piece of shit but the latest os to grace it has been bt4 and i used it for obvious reasons

when i actually want a computer, i use windows you jabroni fuck
Title: Re: Need to delete folders from HDD based on rule...
Post by: hatchboy on October 24, 2009, 12:34:52 AM
when i actually want a computer, i use windows you jabroni fuck
lol
Title: Re: Need to delete folders from HDD based on rule...
Post by: Kain on October 24, 2009, 12:49:12 AM
so i assume you know how to use the power shell. why are you asking simple questions again since you are such a leet haxor to use bt4?
Title: Re: Need to delete folders from HDD based on rule...
Post by: Teg2boo on October 24, 2009, 01:57:28 AM
i can write something in vb for it but we live in an age where coding your own is much harder than requesting a link to someone who has already done it



Oh man, today I wrote like 700 lines of code and I can't disagree with you lol
Title: Re: Need to delete folders from HDD based on rule...
Post by: BoostedSchemes on October 24, 2009, 01:38:28 PM
so i assume you know how to use the power shell. why are you asking simple questions again since you are such a leet haxor to use bt4?

because im not a fucking midget you fucking dwarf fuck
Title: Re: Need to delete folders from HDD based on rule...
Post by: Joseph Davis on October 24, 2009, 01:44:08 PM
In this thread buk bends over backwards to lick Yuriy's nuts, and Yuriy doesn't so much as acknowledge him.

Classic.
Title: Re: Need to delete folders from HDD based on rule...
Post by: BoostedSchemes on October 24, 2009, 01:57:34 PM
in this thread dwarves further show us why they live in deep underground mines and reproduce through mitosis
Title: Re: Need to delete folders from HDD based on rule...
Post by: Kain on October 24, 2009, 02:57:54 PM
in this thread dwarves further show us why they live in deep underground mines and reproduce through mitosis

thats pretty fucking weird.
Title: Re: Need to delete folders from HDD based on rule...
Post by: buk9tp on October 24, 2009, 05:13:45 PM
In this thread buk bends over backwards to lick Yuriy's nuts, and Yuriy doesn't so much as acknowledge him.

Classic.

in this thread jd rides the fence to stay cool on the internet because noone cares about his bullshit off of the internet
Title: Re: Need to delete folders from HDD based on rule...
Post by: random-strike on October 24, 2009, 06:09:32 PM
i'll write a prog to do this if you can wait abnout 30 mins
Title: Re: Need to delete folders from HDD based on rule...
Post by: random-strike on October 24, 2009, 07:00:49 PM
uhh remember deleting files is semi permanent.

this is not recursive, only top level directories.

http://www.realhomemadeturbo.com/johnny/WindowsFormsApplication1.zip (http://www.realhomemadeturbo.com/johnny/WindowsFormsApplication1.zip)

Quote
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        private int deldircount = 0;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                double directorySize = 0.00;
                directorySize = getAllDirs(txtDir.Text);
                txtDir.Text = "Deleted Directories: " + deldircount;
            }
            catch (Exception ex)
            {
                txtDir.Text = ex.Message;
            }
            finally
            {
            }           
        }

        private void deleteDir(string dir)
        {
            Directory.Delete(dir, true);
            deldircount += 1;
        }

        private double getAllDirs(string dir)
        {
            double size = 0.00;
            foreach (string d in Directory.GetDirectories(dir))
            {
                double dirsize = 0.00;
                DirectoryInfo di = new DirectoryInfo(d);
                //dirsize += this.getAllDirs(d);
                dirsize += this.getDirSize(di.FullName);
                if (dirsize < Convert.ToDouble(txtFileSize.Text))
                {
                    this.deleteDir(di.FullName);
                }
            }
            return size;
        }

        private double getDirSize(string dir)
        {
            double size = 0.00;
            foreach (FileInfo f in new DirectoryInfo(dir).GetFiles())
            {
                size += f.Length;
            }
            return size;
        }
    }
}
Title: Re: Need to delete folders from HDD based on rule...
Post by: random-strike on October 24, 2009, 08:46:22 PM
btw the size is in bytes
Title: Re: Need to delete folders from HDD based on rule...
Post by: snm95ls on October 24, 2009, 11:46:42 PM
Is that written in C++?

Not a coder by any means but the structure looks familiar to what I worked with in the one programming class I had to take.

Just curious.
Title: Re: Need to delete folders from HDD based on rule...
Post by: Joseph Davis on October 24, 2009, 11:52:13 PM
In this thread buk accuses me of straddling a fence just because I don't find anything in the thread interesting enough to comment on, and furthermore I don't care about his and Yuriy's lover spat.

Then he deletes his account.
Title: Re: Need to delete folders from HDD based on rule...
Post by: bigdaddyvtec on October 25, 2009, 12:05:24 AM
Is that written in C++?

Not a coder by any means but the structure looks familiar to what I worked with in the one programming class I had to take.

Just curious.


Visual studio / C#
Title: Re: Need to delete folders from HDD based on rule...
Post by: random-strike on October 25, 2009, 12:22:02 AM
ya its c#

i figured a windows form would be easiest to use