New
#80
Hi,
Yep I don't use this anymore no need disk space is cheap now days
If someone really needs the little space it might find it is past time to get a larger ssd or hdd
Hi,
Yep I don't use this anymore no need disk space is cheap now days
If someone really needs the little space it might find it is past time to get a larger ssd or hdd
Hi Everyone,
If I setup a task to run the VBS file at a certain time, every day, How can I make the task hit ok and just run it minimized?
I'm guessing I need to add a few extra commands?
Thank You !!
Good evening,
I know this is an old thread now but I have a question please about Windows 7: Disk Cleanup : Extended.
Excellent by the way Bare Foot Kid .
I want to include this and run it in a batch file at the end of other stuff that is done (I have condensed the code below to just include the Disk Cleanup : Extended portion).
It does actually work fine but I have to press "OK" for it to continue or "Cancel" to not.
How can I adapt the script below so it automatically presses the "OK" for me in the script please?
I don't want the popup box to appear I just want it to do it.
I have tried /Q at the end, I have also tried Click [OK] but to no avail.
I have also tried all of the following: (with the cd C:\windows\system32 first obviously)
C:\Windows\System32\Cmd.exe /c Cleanmgr /sageset:65535 & Cleanmgr /sagerun:65535
Shell ("%SystemRoot%\System32\Cmd.exe /c Cleanmgr /sageset:65535 & Cleanmgr /sagerun:65535")
Shell C:\Windows\System32\Cmd.exe /c Cleanmgr /sageset:65535 & Cleanmgr /sagerun:65535
Shell "C:\Windows\System32\Cmd.exe /c Cleanmgr /sageset:65535 & Cleanmgr /sagerun:65535"
Shell ("C:\Windows\System32\Cmd.exe /c Cleanmgr /sageset:65535 & Cleanmgr /sagerun:65535")
Unfortunately on the occasions when Shell is included it gives me an error saying:
'Shell' is not recognised as an internal or external command, operable program or batch file.
Anyway, here is the batch file script I have:
Any help will be greatly appreciated.Code:echo off echo. echo [12] Running extended cleanup... cd C:\windows\system32 %SystemRoot%\System32\Cmd.exe /c Cleanmgr /sageset:65535 & Cleanmgr /sagerun:65535 echo. & echo This process completed successfully. & echo. & pause & cls exit
Thanks in advance.
Hello Paul, :)
If you like, you could use the same command below from Option Two below. The command needs to "Run as administrator" (elevated).
cmd.exe /c Cleanmgr /sageset:65535 & Cleanmgr /sagerun:65535
Open and Use Disk Cleanup in Windows 10 Windows 10 Tutorials
Thanks for the reply Brink, it is appreciated.
Unfortunately this still requires me to click the OK button to continue, which is what I want to bypass!
I just want it to run without me having to do this.
Everything else runs without problems. I am using DISM commands etc before hand and I just want to tidy up after the batch file has completed (that is why I want to execute this as the last thing in the batch file).
As you will see from my code, it will allow it to run to completion (so there are no interuptions to it running) before anything can be done, i.e. Pause = Press any key to continue.
Thanks in advance.
You could use the method below to create an elevated shortcut of it to run elevated without getting a UAC prompt.
Elevated Program Shortcut without UAC Prompt - Create - Windows 7 Help Forums
Thanks again Brink for the reply.
I don't have the UAC enabled so that is not a problem.
I need to run it from WITHIN my batch script that I posted and for it to ignore the popup asking me to click OK or Cancel.
Thanks in advance.
OK, thanks anyway Brink for your time and help with this, it is very much appreciated .
I think I have worked out how to do it, sort of (well I don't have to click OK or Cancel)!
This also seems to work:Code:echo off echo. echo [12] Running extended cleanup... cd C:\windows\system32 Start %SystemRoot%\System32\Cmd.exe /c Cleanmgr /sageset:65535 & Cleanmgr /sagerun:65535 echo. & echo This process completed successfully. & echo. & pause & cls exit
If anyone knows if this is WRONG then please let me know.Code:echo off echo. echo [12] Running extended cleanup... cd C:\windows\system32 Start Cmd.exe /c Cleanmgr /sageset:65535 & Cleanmgr /sagerun:65535 echo. & echo This process completed successfully. & echo. & pause & cls exit
The only problem appears to be is at the end of the cleanup process that there is an extra (so I have 2) disk cleanup box that appears (but goes off in about 3 seconds).
The first box says "Scanning: whatever" for example and the second box says "Cleaning: whatever".
Any ideas please?
Thanks in advance.
EDIT:
I have worked it out!
The clicking of the OK button obviously invokes the program to start, hence using Start at the beginning of the command.
The second box only appears because I moved the first box to another location on the screen.
I ran the command from the desktop shortcut that I had created a long time ago (and NOT from inside the batch file itself) leaving the normal position of the box in the middle of the screen and I didn't get a second box appear.
I then ran the command again from the desktop shortcut that I had created a long time ago (and NOT from inside the batch file itself) but this time moving the normal position of the box in the middle of the screen and I DID get a second box appear.
This means that there are 2 boxes generated when the command is run, the 1st box saying Scanning: whatever and the 2nd box saying Cleaning: whatever. The 2nd box is exactly mirrored on top of the 1st box.
I then tested BOTH these scenarios above by running it from WITHIN the Batch file and got EXACTLY the SAME results.
I hope this will help anyone trying to do this in the future.
Brink,
Out of the two code options I posted above, is there one that is better to use than the other one please?
Last edited by Paul Black; 18 Mar 2018 at 18:56.