Windows Startup Script - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Microsoft Windows and Software
Click Here to Login
Closed Thread
 
Thread Tools Display Modes
 
Old 07-07-2006, 04:39 PM   #1 (permalink)
rtg
Newb Techie
 
Join Date: Jul 2006
Posts: 2
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)
Monster Techie
 
MrCoffee's Avatar
 
Join Date: Feb 2006
Location: UK
Posts: 1,858
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)
Monster Techie
 
MrCoffee's Avatar
 
Join Date: Feb 2006
Location: UK
Posts: 1,858
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
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 Off




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 11:38 AM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.