AutoHotkey Community

It is currently May 26th, 2012, 11:47 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: August 30th, 2008, 6:53 pm 
Offline

Joined: November 1st, 2007, 10:03 pm
Posts: 885
PC Care is program that does the dirty work for you.

It automatically senses if Temporary folders are oversized and ask you if you want them to be deleted.

It also supports Plugins, which allows you to create your own plugin to delete a specific folder when it is oversized.

Right now PC Care only monitors the cookie folder and the temporary folder, though I will release some plugins I encourage you to make your own.

Down the page is where you can learn how to make your own plugin and how to install plugins

Download: Source

Plugins:





Installing A Plugin:
Its very simple to install a plugin, Create a plugin folder in the same directory as the PC Care.ahk script, and place the plugin files in the Plugin Folder.

Creating A Plugin:
Creating a plugin isn't hard either.

Lets look at a plugin

Code:
SetBatchLines -1
#Persistent
SetTimer,Recent,250
return

Recent:
FolderSize3 = 0
WhichFolder = %Systemdrive%\Documents and Settings\%A_Username%\Recent\*.*
Loop, %WhichFolder%\*.*, , 1
    FolderSize += %A_LoopFileSize%
If FolderSize > 262144
    {
     msgbox,4,,Recent Files Folder is over A Quarter Kilobyte`nDo you want to Delete?
     IfMsgBox, Yes
        {
         run Temporary.bat
         return
        }     
      Else
        return
     }
return


WhichFolder is the folder path that is going to be monitored.

FolderSize is the size in bytes that the folder cant go over.

Once the folder is over the allowed size a message box shows up asking you if you want to delete that folder.

As an alternative, you can use the filedelete command to delete the folder if the files in the folder are not in use.

If the user selects Yes, it runs a batch file which deletes the folder

Heres an example of a new plugin


Code:
SetBatchLines -1
#Persistent
SetTimer,Example,250
return

Recent:
FolderSize3 = 0
WhichFolder = %Systemdrive%\My Test Folder
Loop, %WhichFolder%\*.*, , 1
    FolderSize += %A_LoopFileSize%
If FolderSize > 262144
    {
     msgbox,4,,Test Folder is over A Quarter Kilobyte`nDo you want to Delete?
     fMsgBox, Yes
        {
         run TestFolder.bat ;Or you can use filedelete if the file is not in use
         ;filedelete %Systemdrive%\My Test Folder\*.*
         return
        }     
      Else
        return
     }
return


That plugin monitors the My Test folder on the C:\

Well thats all, reply if you want a plugin made or theres a bug


PS: Its my bday!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2008, 8:18 pm 
Offline

Joined: July 15th, 2007, 1:43 am
Posts: 1320
Tip:

Quote:
Code:
; ...
FolderSize += %A_LoopFileSize%
; ...


Percent signs not needed:

Code:
; ...
FolderSize += A_LoopFileSize
; ...

_________________
Religion is false. >_>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2008, 8:22 pm 
Offline

Joined: November 1st, 2007, 10:03 pm
Posts: 885
Thanks Ian, but does it make a difference?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2008, 9:09 pm 
Offline

Joined: November 2nd, 2004, 2:43 pm
Posts: 1019
Location: London, UK
I would suggest reading the correct directories from the Registry, the directories you have in your script could be invalid in quite a few systems.

_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2008, 11:42 pm 
Offline

Joined: July 15th, 2007, 1:43 am
Posts: 1320
I think it to be faster, but do a benchmark test and see.

PS: Happy 11th bday!

_________________
Religion is false. >_>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 31st, 2008, 4:30 am 
Offline

Joined: November 1st, 2007, 10:03 pm
Posts: 885
Thanks


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: oldbrother, Rajat and 61 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group