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, defrag script doesnt work system, cleanup defrag script, the visual freelancer, temp work, script resume, sample of resume, sample of a resume, sample it resume, root freelancer, resume sample, resume freelancer, post freelancer resume, mean of freelancer, it resume sample, help to setup as a freelancer, freelancer profile setup, freelancer not go, freelancer mean, freelancer in visual basic, freelancer hired, freelancer for windows

Tietoa työnantajasta:
( 10 arvostelua ) Fresno, United States

Projektin tunnus: #412537

Myönnetty käyttäjälle:


Expert in Vb and vb script. Ready to start. Regards [login to view URL] B.E

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

5 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% 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 [login to view URL] 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 [login to view URL] on Windows. Reards. Buddhika

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