Windows Startup Script

Status
Not open for further replies.

rtg

Beta member
Messages
2
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
 
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 :confused:
 
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.
 
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
 
Status
Not open for further replies.
Back
Top Bottom