:::RHMT::: Real Home Made Turbo

Please login or register.

Login with username, password and session length
Advanced search  

News:

Jay & Trevor YOU WILL BE MISSED, RIP  :'(

Pages: [1]   Go Down

Author Topic: Need to delete folders from HDD based on rule...  (Read 4457 times)

BoostedSchemes

  • Certified OG
  • *****
  • Offline Offline
  • Posts: 18561
  • ☂BloodRaincoat☂
Need to delete folders from HDD based on rule...
« 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...
Logged
All posts before 8am and after 3pm are produced under the influence of alcohol.


Major Loser, please tell me how to be smart and interesting like you~

jagojon3

  • Moderator
  • Certified OG
  • *****
  • Offline Offline
  • Posts: 17261
Re: Need to delete folders from HDD based on rule...
« Reply #1 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
Logged

Turkey soup pancakes sir

buk9tp

  • Guest
Re: Need to delete folders from HDD based on rule...
« Reply #2 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
Logged

buk9tp

  • Guest
Re: Need to delete folders from HDD based on rule...
« Reply #3 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
Logged

BoostedSchemes

  • Certified OG
  • *****
  • Offline Offline
  • Posts: 18561
  • ☂BloodRaincoat☂
Re: Need to delete folders from HDD based on rule...
« Reply #4 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

Logged
All posts before 8am and after 3pm are produced under the influence of alcohol.


Major Loser, please tell me how to be smart and interesting like you~

crttaz

  • Certified OG
  • *****
  • Offline Offline
  • Posts: 1831
  • Old Wise One
Re: Need to delete folders from HDD based on rule...
« Reply #5 on: October 23, 2009, 10:35:45 PM »

Sort by size, delete in batches.
Logged
OG before the OG'#039#039s

jagojon3

  • Moderator
  • Certified OG
  • *****
  • Offline Offline
  • Posts: 17261
Re: Need to delete folders from HDD based on rule...
« Reply #6 on: October 23, 2009, 10:40:07 PM »

How are you going to sort folders by size?
Logged

Turkey soup pancakes sir

buk9tp

  • Guest
Re: Need to delete folders from HDD based on rule...
« Reply #7 on: October 23, 2009, 10:47:42 PM »

Logged

BoostedSchemes

  • Certified OG
  • *****
  • Offline Offline
  • Posts: 18561
  • ☂BloodRaincoat☂
Re: Need to delete folders from HDD based on rule...
« Reply #8 on: October 23, 2009, 10:55:16 PM »

looks like buk wins  :D
Logged
All posts before 8am and after 3pm are produced under the influence of alcohol.


Major Loser, please tell me how to be smart and interesting like you~

buk9tp

  • Guest
Re: Need to delete folders from HDD based on rule...
« Reply #9 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
Logged

Kain

  • Certified OG
  • *****
  • Offline Offline
  • Posts: 6030
Re: Need to delete folders from HDD based on rule...
« Reply #10 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.

BoostedSchemes

  • Certified OG
  • *****
  • Offline Offline
  • Posts: 18561
  • ☂BloodRaincoat☂
Re: Need to delete folders from HDD based on rule...
« Reply #11 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
Logged
All posts before 8am and after 3pm are produced under the influence of alcohol.


Major Loser, please tell me how to be smart and interesting like you~

hatchboy

  • my wife= hotter than a 2 dollar pistol.
  • Certified OG
  • *****
  • Offline Offline
  • Posts: 3607
  • Bombs Over Baghdad
Re: Need to delete folders from HDD based on rule...
« Reply #12 on: October 24, 2009, 12:34:52 AM »

when i actually want a computer, i use windows you jabroni fuck
lol

Kain

  • Certified OG
  • *****
  • Offline Offline
  • Posts: 6030
Re: Need to delete folders from HDD based on rule...
« Reply #13 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?

Teg2boo

  • Certified OG
  • *****
  • Offline Offline
  • Posts: 4261
Re: Need to delete folders from HDD based on rule...
« Reply #14 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
Logged


damn you guys too? its a fucking forum not a court room!
 Its not a forum its a gang.  

BoostedSchemes

  • Certified OG
  • *****
  • Offline Offline
  • Posts: 18561
  • ☂BloodRaincoat☂
Re: Need to delete folders from HDD based on rule...
« Reply #15 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
Logged
All posts before 8am and after 3pm are produced under the influence of alcohol.


Major Loser, please tell me how to be smart and interesting like you~

Joseph Davis

  • Verbal Assault Technician
  • RHMT Moderator
  • Certified OG
  • *****
  • Offline Offline
  • Posts: 34733
  • Eugenics prevents retards like widebody93
    • TURBO THIS
Re: Need to delete folders from HDD based on rule...
« Reply #16 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.

BoostedSchemes

  • Certified OG
  • *****
  • Offline Offline
  • Posts: 18561
  • ☂BloodRaincoat☂
Re: Need to delete folders from HDD based on rule...
« Reply #17 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
Logged
All posts before 8am and after 3pm are produced under the influence of alcohol.


Major Loser, please tell me how to be smart and interesting like you~

Kain

  • Certified OG
  • *****
  • Offline Offline
  • Posts: 6030
Re: Need to delete folders from HDD based on rule...
« Reply #18 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.

buk9tp

  • Full Member
  • ***
  • Offline Offline
  • Posts: 187
  • i know nuthin bout nuthin
Re: Need to delete folders from HDD based on rule...
« Reply #19 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
Logged

random-strike

  • Certified OG
  • *****
  • Online Online
  • Posts: 19582
Re: Need to delete folders from HDD based on rule...
« Reply #20 on: October 24, 2009, 06:09:32 PM »

i'll write a prog to do this if you can wait abnout 30 mins
Logged
Double doors, marble floors, naked hoes around me

random-strike

  • Certified OG
  • *****
  • Online Online
  • Posts: 19582
Re: Need to delete folders from HDD based on rule...
« Reply #21 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

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;
        }
    }
}
Logged
Double doors, marble floors, naked hoes around me

random-strike

  • Certified OG
  • *****
  • Online Online
  • Posts: 19582
Re: Need to delete folders from HDD based on rule...
« Reply #22 on: October 24, 2009, 08:46:22 PM »

btw the size is in bytes
Logged
Double doors, marble floors, naked hoes around me

snm95ls

  • Certified OG
  • *****
  • Offline Offline
  • Posts: 3662
Re: Need to delete folders from HDD based on rule...
« Reply #23 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.

Joseph Davis

  • Verbal Assault Technician
  • RHMT Moderator
  • Certified OG
  • *****
  • Offline Offline
  • Posts: 34733
  • Eugenics prevents retards like widebody93
    • TURBO THIS
Re: Need to delete folders from HDD based on rule...
« Reply #24 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.

bigdaddyvtec

  • Certified OG
  • *****
  • Offline Offline
  • Posts: 8948
  • Go outside and play hide and go fuckyourself
Re: Need to delete folders from HDD based on rule...
« Reply #25 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#
Logged
http://i256.photobucket.com/albums/hh166/joeymisanthropy/Misce/TURBOTHIS.jpg

H series 35 pounds... Will turn you out!
 ---GFI we build FAST---

random-strike

  • Certified OG
  • *****
  • Online Online
  • Posts: 19582
Re: Need to delete folders from HDD based on rule...
« Reply #26 on: October 25, 2009, 12:22:02 AM »

ya its c#

i figured a windows form would be easiest to use
Logged
Double doors, marble floors, naked hoes around me
Pages: [1]   Go Up