Disk Cleanup : Extended

Page 9 of 10 FirstFirst ... 78910 LastLast

  1. Posts : 20,583
    Win-7-Pro64bit 7-H-Prem-64bit
       #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
      My Computer


  2. Posts : 46
    Windows 7 64 Bit
       #81

    Auto Run In Task Scheduler


    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 !!
      My Computer


  3. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
       #82

    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:

    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
    Any help will be greatly appreciated.

    Thanks in advance.
      My Computer


  4. Posts : 72,062
    64-bit Windows 11 Pro for Workstations
       #83

    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
      My Computer


  5. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
       #84

    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.
      My Computer


  6. Posts : 72,062
    64-bit Windows 11 Pro for Workstations
       #85

    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
      My Computer


  7. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
       #86

    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.
      My Computer


  8. Posts : 72,062
    64-bit Windows 11 Pro for Workstations
       #87

    Ah, you want it to run silently.

    I'm not aware of a way to do so.
      My Computer


  9. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
       #88

    OK, thanks anyway Brink for your time and help with this, it is very much appreciated .
      My Computer


  10. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
       #89

    I think I have worked out how to do it, sort of (well I don't have to click OK or Cancel)!

    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
    This also seems to work:

    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
    If anyone knows if this is WRONG then please let me know.

    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.
      My Computer


 
Page 9 of 10 FirstFirst ... 78910 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:41.
Find Us