Windows Cleanup and Defrag Script

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 [url removed, login to view] and [url removed, login to view] 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 [url removed, login to view] 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


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")

[url removed, login to view] HKEY_LOCAL_MACHINE, VOLUME_CACHES_KEY, aSubKeys

For Each sSubkey in aSubKeys

' [url removed, login to view] vbTab & vbTab & "Case """ & sSubkey & """"

' [url removed, login to view] vbTab & vbTab & vbTab & "EnsureStateFlagEntries objReg, sSubkey, 0, lTaskState"

' [url removed, login to view]

If ([url removed, login to view](sSubkey)) Then

lTaskState = 0


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

Taidot: Järjestelmänvalvoja, Visual Basic, Windows Desktop

Näytä lisää: defrag script, windows cleanup script, cleanup script, windows defragmentation script, cleanup defrag script, temp work, script resume, root freelancer, resume freelancer, post freelancer resume, resume sample, help setup freelancer, freelancer profile setup, freelancer hired, freelancer exe, freelancer error, freelancer run, freelancer create profile, freelancer cleaner, freelancer case, freelancer adding someone, echo freelancer, default freelancer, case freelancer, basic works freelancer

About the Employer:
( 10 reviews ) Fresno, United States

Projektin tunnus: #412537

Myönnetty käyttäjälle:


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

100 $ USD 2 päivässä
(26 arvostelua)

5 freelanceria on tarjonnut keskimäärin 108 $ tähän työhön


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 dif Lisää

30 $ USD 0 päivässä
(1 arvostelu)

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 [url removed, login to view] files in temporary interne Lisää

60 $ USD 2 päivässä
(5 arvostelua)

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

200 $ USD 2 päivässä
(0 arvostelua)

HI, I can do this in C++ and using built in [url removed, login to view] on Windows. Reards. Buddhika

150 $ USD 5 päivässä
(0 arvostelua)