Project Detail

Windows Cleanup and Defrag Script  

Windows Cleanup and Defrag Script is project number 412537
posted at Freelancer.com. Click here to post your own project.

 

| More Free Trial For New Buyers
 

Status:

Selected Providers: crajeshbe

Budget: $30-250

Created: 04/02/2009 at 19:03 EDT

Bid Count: 5

Average Bid:
$ 108

04/09/2009 at 19:03 EDT

Project Creator: kharoldsen
Employer Rating: 10/1010/1010/1010/1010/1010/1010/1010/1010/1010/10 (1 reviews)

Bid On This Project
 

Description

We hired a freelancer some time ago to create a script that would automatically cleanup and Windows PC and run a defrag. This all needs to happen once a month after-hours. The script we have runs fine, but it only works for one user. It does not cleanup files (temp internet, etc.) for all users. The existing script is a .vbs and runs the built-in cleanmgr.exe and defrag.exe on Windows. I need someone to go through this script and make it work for all users. This may mean that we need to dump using the cleanmgr.exe and go with something else. Anyway, if you can help us then please post a reply.

Here is a sample of the script -

Set objShell = Nothing
Set dctXcludedCleanups = Nothing



'Refer to section - "ADDING A TASK PROFILE "PROGRAMMATICALLY""
Private Sub AddTaskProfile()

On Error Resume Next

Dim objReg
Dim aSubKeys()
Dim sComputer, sSubkey, lTaskState

sComputer = "."
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
sComputer & "\root\default:StdRegProv")

objReg.EnumKey HKEY_LOCAL_MACHINE, VOLUME_CACHES_KEY, aSubKeys

For Each sSubkey in aSubKeys
' Wscript.Echo vbTab & vbTab & "Case """ & sSubkey & """"
' Wscript.Echo vbTab & vbTab & vbTab & "EnsureStateFlagEntries objReg, sSubkey, 0, lTaskState"
' Wscript.Echo

If (dctXcludedCleanups.Exists(sSubkey)) Then
lTaskState = 0
Else
lTaskState = 2
End If

Select Case sSubkey

Case "Active Setup Temp Folders"
EnsureStateFlagEntries objReg, sSubkey, 0, lTaskState

Case "Compress old files" 'May skip as it might take long time and might hang script
EnsureStateFlagEntries objReg, sSubkey, 1, lTaskState

Case "Content Indexer Cleaner"
EnsureStateFlagEntries objReg, sSubkey, 1, lTaskState

Case "Downloaded Program Files"
EnsureStateFlagEntries objReg, sSubkey, 1, lTaskState

Messages Posted:1 View project clarification board Post message on project clarification board

Bid On This Project
 

If you are the project creator or one of the bidders Log In for more options

 

100

2 days

04-02-2009 22:00 EDT

Expert in Vb and vb script. Ready to start. Regards C.Rajesh B.E

help

 

30

0 days

04-03-2009 00:13 EDT

I will tell you a thing and you will be able to do it for all users by urself. It can be done through task scheduler, it can run tasks in different user's context. Just add your executable in the task scheduler for different user's context and this program will work as expected. Set the trigger to monthly and even then you dont need to clean by you own. Hope this helps:) Thanks, Zeeshan

help

 

60

2 days

04-03-2009 08:53 EDT

I know how to do that without the build-in cleaner for any user. simply the script will have to be run in an administrator context to have write permission on all user profiles. The index.dat files in temporary internet files will not be truncated.

help

 

200

2 days

04-02-2009 22:54 EDT

(No Feedback Yet)

Hi, I'll deliver this solution. Please see PMB for details Regards, John

help

 

150

5 days

04-02-2009 23:36 EDT

(No Feedback Yet)

HI, I can do this in C++ and using built in defrag.exe on Windows. Reards. Buddhika

help


    Bid on this Project