Home > Disk Cleanup > Vbscript To Run Disk Cleanup

Vbscript To Run Disk Cleanup


Close Reply To This Thread Posting in the Tek-Tips forums is a member-only feature. as user can stop it... Keep in touch with Experts ExchangeTech news and trends delivered to your inbox every month Membership How it Works Gigs Live Careers Plans and Pricing For Business Become an Expert Resource One quick question if I rewrite the reg entries to disabled/enabled will it work fine? http://1pxcare.com/disk-cleanup/can-you-run-disk-defrag-disk-cleanup-same-time.html

All Rights Reserved. expandcollapse popupAddHandler_FireFox() Func AddHandler_FireFox() Local Const $KeyPath = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\FireFox Cache" Local Const $Default = "{C0E13E61-0CC6-11d1-BBB6-0060978B2AE6}" Local Const $Display This may take a few minutes to complete.2008-08-22 16:21:07 : Status: Calculating...2008-08-22 16:21:07 : Status: WebClient/Publisher Temporary Files2008-08-22 16:21:07 : Status: Target type:2008-08-22 16:21:07 : Status: exefile2008-08-22 16:21:07 : Status: Disk WshShell.run "wuinstall.exe /install /reboot_if_needed" And don’t forget to do a quick defrag of the hard drive by adding the following lines to the script.

Powershell Script To Run Disk Cleanup

Yes, you can schedule the Windows script to run using Windows scheduler - it'll launch on its own and you don't have to do a thing. #3 is a really cool Reply Ryan Dube November 5, 2011 at 2:46 pm Yeah - unfortunately not all antivirus software packages offer a command line mode. If parameter count is proper then extract drive name and batch file path; else show syntax help to user. csidl [in] A CSIDL that identifies the folder of interest.

  • Do", 6) EndIf EndFunc Func AddHandler_FireFox() Local Const $KeyPath = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\FireFox Cache" Local Const $Default
  • Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI
  • Syntax BOOL SHGetSpecialFolderPath( HWND hwndOwner, LPTSTR
  • Regards, Rob. 0 LVL 65 Overall: Level 65 VB Script 59 Windows 2000 4 Message Active 2 days ago Expert Comment by:RobSampson ID: 353805482011-04-12 Thanks for the grade.

As far as being silent, this script attempts to start CleanMgr.exe in a hidden window. JeffIt's never too early to begin preparing for International Talk Like a Pirate Day"The software I buy sucks,The software I write sucks.It's time to give up and have a beer..." - Option Explicit On Error Resume Next SetRegKeys DoCleanup Sub DoCleanup() Dim WshShell Set WshShell=CreateObject("WScript.Shell") WshShell.Run "C:\WINDOWS\SYSTEM32\cleanmgr /sagerun:1" End Sub Sub SetRegKeys Dim strKeyPath Dim strComputer Dim objReg Dim arrSubKeys Dim SubKey What Is Kurt Cleanup Script I can use a script to load it into my users scheduled tasks. 0 Tabasco OP Mike Mullen Apr 21, 2009 at 4:39 UTC Premier Technology Services is

So I decided to use WSH VBScript to determine hard disk space and then ask it run a custom batch file when free space in disk went below certain GB. Already a member? By joining you are opting in to receive e-mail. Im trying to push this thing out to my domain via group policy.

Did it work well, and can you think of any other useful command line tasks that could also be added? Cleanmgr Options M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from Please help out. Those four parameters after the spybotsd.exe file  will run Spybot in silent mode, automatically remove any spyware found, and then automatically close.

Disk Cleanup Script Windows 7

It's still a very good idea to manually update those apps with the latest updates/definitions every now and then. http://stackoverflow.com/questions/23760812/log-disk-clean-up-vbscript Background I assume that reader of this article know some basics of WSH and batch file. Powershell Script To Run Disk Cleanup This will create a registry entry containing the settings with the cleanup options and after this, you can run cleanmgr.exe /sagerun:1 which will actually execute the cleanup. Disk Cleanup Batch File This video shows you how.

Select Case WScript.Arguments.Count Case 3 '+++++++++++++++++++++++++++++++++++++++ 'Convert drive letter to upper case. '+++++++++++++++++++++++++++++++++++++++ strDriveToMonitor = UCase (Wscript.Arguments(0)) strFreeSpaceNeeded = Wscript.Arguments(1) strBatchFileToRun = Wscript.Arguments(2) Case Else '++++++++++++++++++++++++++++++ ' Call the display syntax have a peek at these guys It frees up my time to work on more projects. You should be able to see it running in the Task Manager however. REM ############## Automatic Disk Clean-up ################ REM ########## Note: This window has a pop-up ############# c:\windows\system32\cleanmgr.exe /sagerun:10 0 Pimiento OP kevincrouch2 Oct 4, 2015 at 5:41 UTC better Pc Run Commands List

I will later wrap it using WISE Re-packaging tool and then deploy it thorugh SCCM 2007.Its really urgent...!!!!! This solution incorporates six tools into a Windows script. Reply Ryan Dube October 28, 2011 at 3:32 am Awesome - glad it's helpful. check over here To automate other extensions, create a "StateFlags0001" property in the corresponding Registry key, as done in the New-ItemProperty lines.

Moderators 2,254 26,827 posts #11 ·  Posted January 26, 2014 ricksaul,Please do not double post - I have deleted your other post with exactly the same question (which I had already answered). Batch File To Delete Temp Files Windows 7 TECHNOLOGY IN THIS DISCUSSION Read these next... © Copyright 2006-2017 Spiceworks Inc. Read More recently, so you can see just what it is capable of and how much it can optimize your system.

I am super burned out right now from a long night of updates, so I don't know if someone already posted this but I actually found a workaround for that.

Automate Disk Cleanup Another common tool that can help computer performance is the Windows Disk Cleanup tool.  First you have to set it up. Go to top Permalink | Advertise | Privacy | Terms of Use | Mobile Web02 | 2.8.170106.1 | Last Updated 1 Aug 2014 Article Copyright 2014 by Gautham Prabhu KEverything else Let me know. Windows Cleanup Script Join Now I have been working on a vbs script silent disk cleanup.

Username Forum Password I've forgotten my password Remember me This is not recommended for shared computers Sign in anonymously Don't add me to the active users list Privacy Policy Home Silent He likes to design and build them efficiently, he has primarily worked on Microsoft .NET technology.Gautham has dream of building his own software company someday. Not the answer you're looking for? this content If a virtual folder is specified, this function will fail.

Downloaded Program Files Temporary Internet Files Recycle Bin Temporary Files Compress Old Files Catalog files for the Content indexer 0 LVL 65 Overall: Level 65 VB Script 59 Windows 2000 Rob. 0 Enterprise Mobility and BYOD For Dummies Promoted by Acronis Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and By creating an account, you're agreeing to our Terms of Use and our Privacy Policy Not a member? Privacy Policy Support Terms of Use current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list.

What I want is can I eleminate the step of manually setting up the options for disk cleanup?? Microsoft Customer Support Microsoft Community Forums Jump to content AutoIt Example Scripts Existing user? Attend this month’s webinar to learn more. The option that I am aware of is as follows 1) cleanmgr.exe /d c: /sageset:11 2) the disk cleanup window will open up for me to choose what all to clear

And freeze them back with deepfreeze to preserve the changes  0 Pimiento OP kevincrouch2 Oct 4, 2015 at 5:47 UTC oh, I forgot to post the link to