Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 07-07-2006, 04:39 PM   #1 (permalink)
rtg
 
Newb Techie

Join Date: Jul 2006

Posts: 2

rtg

Default Windows Startup Script

I am trying to write a startup script that calculates folder size and if folder size is over 200mb, the script executes the appropriate command to empty the folder. i'm using Windows.

can somebody help me?

Im not sure if I can do this with a batch script or if i need to use something else. I would appreciate any help I can get.

Thanks,

Rob
rtg is offline  
Old 07-07-2006, 05:16 PM   #2 (permalink)
MrCoffee's Avatar
 
Monster Techie

Join Date: Feb 2006

Location: UK

Posts: 1,852

MrCoffee is on a distinguished road

Default

Ok I dont have a solution for you but maybe this will be a step in the right direction.
I just made a script that checks the size of a file (not a folder sadly) then deletes it if its over 10kb.

call :trash c:\test.txt
:trash
if %~z1 GEQ 10000 del c:\test.txt

That probably doesn't help i guess
__________________
Intel core I7 920
GA-EX58-UD3R
6GB OCZ platinum 1600
XFX HD4890
Noctua nh-u12p
Corsair HX520
Antec 300
Samsung 1TB F1 Spinpoint
Samsung SM2443BW 24"
MrCoffee is offline  
Old 07-07-2006, 05:47 PM   #3 (permalink)
MrCoffee's Avatar
 
Monster Techie

Join Date: Feb 2006

Location: UK

Posts: 1,852

MrCoffee is on a distinguished road

Default

you might be able to get some mileage out of the diruse command in the support tools. Thats the only thing in dos I can find that give the size of a folder.
__________________
Intel core I7 920
GA-EX58-UD3R
6GB OCZ platinum 1600
XFX HD4890
Noctua nh-u12p
Corsair HX520
Antec 300
Samsung 1TB F1 Spinpoint
Samsung SM2443BW 24"
MrCoffee is offline  
Old 07-07-2006, 06:32 PM   #4 (permalink)
rtg
 
Newb Techie

Join Date: Jul 2006

Posts: 2

rtg

Default

I was able to write a vbs script as follows:

Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder("d:\test\")
if folder.size>1024000000 then folder.Delete
rtg is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On