Windows 10: Why won't cleanmgr work in a batch file

Discus and support Why won't cleanmgr work in a batch file in Windows 10 Support to solve the problem; I've previously run cleanmgr /sageset:1 and checked everything including Recycle Bin. If I run cleanmgr /sagerun:1 from a command prompt, the... Discussion in 'Windows 10 Support' started by Bob Coleman, Jun 16, 2017.

  1. Why won't cleanmgr work in a batch file


    I've previously run cleanmgr /sageset:1 and checked everything including Recycle Bin.

    If I run cleanmgr /sagerun:1 from a command prompt, the Recycle Bin is emptied. If I put that command it a batch file, let's say test.bat and run said file without the involvement of a command prompt, the Recycle Bin is not emptied.

    There may or may not be other things that are or are not cleaned. The Recycle Bin is just the first that I noticed and the simplest to experiment with.

    :)
     
    Bob Coleman, Jun 16, 2017
    #1

  2. Batch file won't work in Windows 10

    Hi,

    We would like to assist you with this concern, however, this issue is beyond the scope of this forum. It's best that you post your concern in
    TechNet
    forums
    . This forum is specialized and dedicated to issues like what you're encountering. This forum comprises of IT Specialists and IT Professionals that can provide you further troubleshooting and more information about your concern.

    Regards.
     
    Monica Cam, Jun 16, 2017
    #2
  3. slance310 Win User
    Space issue after upgrading to windows 10

    Hi,

    That probably won't work with Windows.old...

    Do a Disk Cleanup, and after the scan runs you will see a box to cleanup System Files...

    Click this, and all of your residual installation files will be there after another scan...

    Another method would be to right click on C:\Windows\System32\cleanmgr and select Run As Administrator... Then you won't have to scan twice...

    Be warned that this can take awhile... especially if you clean old Windows Updates...
     
    slance310, Jun 16, 2017
    #3
  4. Why won't cleanmgr work in a batch file

    If I use this command, it works, but still have to set it first using: cleanmgr /sageset:65535

    cleanmgr /sagerun:65535

    But I gave up on WIndows doing the right way and I just do it myself anyway:

    del "C:\$Recycle.bin\*" /s /f /q
    del "D:\$Recycle.bin\*" /s /f /q
    del "E:\$Recycle.bin\*" /s /f /q
     
    TairikuOkami, Jun 16, 2017
    #4
  5. I don't see that that command using 65535 works any differently than mine using 1, i.e. it empties the Recycle Bin if invoked at a command prompt, but not if invoked from a batch file.

    I guess, like you, I'll adopt a different strategy for the Recycle Bin. Hopefully cleanmgr cleans up the rest of what it is supposed to.
     
    Bob Coleman, Apr 4, 2018
    #5
Thema:

Why won't cleanmgr work in a batch file

Loading...
  1. Why won't cleanmgr work in a batch file - Similar Threads - Why won't cleanmgr

  2. Batch Files

    in Windows 10 Gaming
    Batch Files: How do i make it that my batch file puts itself in to startup https://answers.microsoft.com/en-us/windows/forum/all/batch-files/6156404d-20d4-4f58-bee5-14629dbf7b10
  3. Batch Files

    in Windows 10 Software and Apps
    Batch Files: How do i make it that my batch file puts itself in to startup https://answers.microsoft.com/en-us/windows/forum/all/batch-files/6156404d-20d4-4f58-bee5-14629dbf7b10
  4. Allow batch file renamer to work?

    in Windows 10 Network and Sharing
    Allow batch file renamer to work?: I'm trying to use a batch file renamer in order to add terms to the beginning of a file:picture1.jpgpicture2.jpgadd "2022 - " to the beginning to give:2022 - picture1.jpg2022 - picture2.jpgFirst off, I'd like a suggestion as to a safe one to use. Free is obviously preferable,...
  5. Allow batch file renamer to work?

    in Windows 10 Gaming
    Allow batch file renamer to work?: I'm trying to use a batch file renamer in order to add terms to the beginning of a file:picture1.jpgpicture2.jpgadd "2022 - " to the beginning to give:2022 - picture1.jpg2022 - picture2.jpgFirst off, I'd like a suggestion as to a safe one to use. Free is obviously preferable,...
  6. Allow batch file renamer to work?

    in Windows 10 Software and Apps
    Allow batch file renamer to work?: I'm trying to use a batch file renamer in order to add terms to the beginning of a file:picture1.jpgpicture2.jpgadd "2022 - " to the beginning to give:2022 - picture1.jpg2022 - picture2.jpgFirst off, I'd like a suggestion as to a safe one to use. Free is obviously preferable,...
  7. Batch file not working

    in Windows 10 Network and Sharing
    Batch file not working: Hello, Iam making autorun project that if I plug Flash disc in my pc it autoruns batch file with my "assistant" what says Hi, what do you want? But here are things that just doesn´t work: 1.If I plug in the Flash disc autorun.inf dont do anything. 2.If I manage batch file...
  8. How to Run CleanMGR to Automatically Include System Files

    in Windows 10 Customization
    How to Run CleanMGR to Automatically Include System Files: I am trying to create a shortcut that will run the CleanMGR with all options selected AND include the System Files. I have found that running: Code: C:\Windows\System32\cleanmgr.exe /LOWDISK This will provide a prompt to the user. or Code: C:\Windows\System32\cleanmgr.exe...
  9. Create batch files with Batch?

    in Windows 10 Software and Apps
    Create batch files with Batch?: How to create Batch and VBS files with Batch? So I write a batch file which I then convert to exe that creates new folders in a certain directory and then creates batch and VBS files with a certain content and saves them in the created folder. So it's similar to a program...
  10. CleanMgr+ and old updates

    in Windows 10 Support
    CleanMgr+ and old updates: Installed CleanMgr+ and it has an option to uninstall old updates??? How can I tell which update is no longer needed? 131957

Users found this page by searching for:

  1. cleanmgr wont run