' cleanc.vbs v1.1 - Limpia y desfragmenta C: - ramiro.encinas@gmail.com - 2008 'Graba las claves correspondientes en el registro opcion = MsgBox("Quieres apagar el ordenador cuando termine todo el proceso?",35,"Limpia y desfragmenta C: - v1.1 - Solo para Windows XP") if opcion = "6" or opcion = "7" Then strComputer = "." Const HKEY_LOCAL_MACHINE = &H80000002 strValueName = "StateFlags0200" strKeyPath1 = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\" Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") Function writereg() oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue End Function dwValue = 2 strKeyPath = strKeyPath1 & "Active Setup Temp Folders" writereg() strKeyPath = strKeyPath1 & "Content Indexer Cleaner" writereg() strKeyPath = strKeyPath1 & "Downloaded Program Files" writereg() strKeyPath = strKeyPath1 & "Internet Cache Files" writereg() strKeyPath = strKeyPath1 & "Memory Dump Files" writereg() strKeyPath = strKeyPath1 & "Microsoft_Event_Reporting_2.0_Temp_Files" writereg() strKeyPath = strKeyPath1 & "Offline Pages Files" writereg() strKeyPath = strKeyPath1 & "Old ChkDsk Files" writereg() strKeyPath = strKeyPath1 & "Remote Desktop Cache Files" writereg() strKeyPath = strKeyPath1 & "Setup Log Files" writereg() strKeyPath = strKeyPath1 & "Temporary Files" writereg() strKeyPath = strKeyPath1 & "WebClient and WebPublisher Cache" writereg() dwValue = 0 strKeyPath = strKeyPath1 & "Compress old files" writereg() strKeyPath = strKeyPath1 & "Office Setup Files" writereg() strKeyPath = strKeyPath1 & "Recycle Bin" 'Ejecuta cleanmgr.exe y defrag.exe con los argumentos correspondientes comando = "" Function ejecuta() Set WshShell = CreateObject("WScript.Shell") WshShell.Run comando, 10, True Set WshShell = Nothing End Function comando = "cleanmgr.exe /sagerun:200" ejecuta() comando = "defrag.exe c:" ejecuta() if opcion = "6" Then comando = "shutdown -s" ejecuta() end If opcion = MsgBox("Proceso terminado",64,"Limpia y desfragmenta C: v1.1") end If