Windows won't remove unused page file

Page 2 of 2 FirstFirst 12

  1. Posts : 124
    Windows 10
    Thread Starter
       #11

    Callender said:
    Click Startup& Recovery settings and under "Write Debugging Information" click the drop down list and change to "none"
    I just have to post this, because it's maddening, frustrating and hilarious at the same time.

    I did this and restarted the computer, but the paging files were still there. So then I reversed it, in other words I set write debugging information back to complete memory dump, to which Win said that it won't work because I either don't have a paging file or it's smaller than 8GB, which goes again to the fact that even though under Virtual Memory the situation is C: system managed, D: none, E: none, I don't actually have a page file. When I look at the page file that exists on C: it hasn't been modified since 24.9. in other words, Windows isn't using it.

    Windows is essentially refusing to carry out any instructions I give it in Virtual Memory pertaining to what to do with paging files.
      My Computer


  2. Posts : 18,034
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #12

    Hello @Alfred001,

    I have put this together for you.

    If you wanted to quickly get the Pagefile(s) data for all drives, Copy & Paste the following [ ALL at once ] into Notepad and Save it as a .bat file. Then you can just run it. It will open a CMD Prompt and output the information.

    Code:
    
    @echo off
    
    echo. & echo  ___ Pagefile(s) ___& echo.
    
    PowerShell ^
         Get-CimInstance -ClassName Win32_PageFileUsage ^| %% {"""{0,-1} {1:N0} MB""" -f ' Total CURRENT Paging Size for ALL Disks:', $_.AllocatedBaseSize; $SystemTotal +=$_.AllocatedBaseSize}
    
    echo.
    PowerShell ^
         $CMD=Get-CimInstance -ClassName Win32_PageFileSetting ^| Sort-Object -Property {$_.Name}; ^
         $Tot =($CMD ^| Measure-Object).Count.ToString('#,##0'); ^
         $List=($CMD ^| Format-Table -AutoSize ^
         @{L='Name'        ;E={;if([string]::IsNullOrWhiteSpace($_.Name))        {'-'} else {$_.Name}}}, ^
         @{L='Initial Size';E={;if([string]::IsNullOrWhiteSpace($_.InitialSize)) {'-'} else {[Math]::Round($_.InitialSize / 1, 0).ToString('#,##0 MB')}}}, ^
         @{L='Maximum Size';E={;if([string]::IsNullOrWhiteSpace($_.MaximumSize)) {'-'} else {[Math]::Round($_.MaximumSize / 1, 0).ToString('#,##0 MB')}}} ^| ^
    Out-String -Width 1000).Trim("""`r`n"""); ^
         if ($List.Length) {Write-Host """`n___ Pagefile(s) - Settings [$Tot] - Sorted by [Name] ___`n`n `n`n$List"""} else {exit 1} >> %Temp%\A.txt
         for /f "delims=" %%i in (%Temp%\A.txt) do echo. %%i
         del %Temp%\A.txt
    
    PowerShell ^
         $Tot=((Get-CimInstance -ClassName Win32_PageFileSetting) ^| Measure-Object).Count; ^
         if ($Tot -gt 0) {Write-Host """`n ___ Pagefile(s) - Locations [$Tot] - Sorted by [Name] ___`n"""} else {exit 1}
    
    PowerShell ^
         $PageFile=Get-CimInstance -ClassName Win32_PageFileSetting; ^
    ForEach ($pag in $PageFile) { ^
      if ($pag.InitialSize -eq 0) { ^
        Write-Host '' $pag.Name "- Automatic Managed Pagefile: True  [System Managed]" ^
        } else { ^
        Write-Host '' $pag.Name "- Automatic Managed Pagefile: False [Custom Managed]" ^
      } ^
    }
    
    PowerShell ^
         $CMD =Get-CimInstance -ClassName Win32_PageFileUsage ^| Sort-Object -Property {$_.Name}; ^
         $Tot =($CMD ^| Measure-Object).Count.ToString('#,##0'); ^
         $List=($CMD ^| Select ^
         @{L=' Name'               ;E={;if([string]::IsNullOrWhiteSpace($_.Name))              {'-'} else {$_.Name}}}, ^
         @{L=' Install Date'       ;E={;if([string]::IsNullOrWhiteSpace($_.InstallDate))       {'-'} else {$_.InstallDate}}}, ^
         @{L=' Allocated Base Size';E={;if([string]::IsNullOrWhiteSpace($_.AllocatedBaseSize)) {'-'} else {[Math]::Round($_.AllocatedBaseSize / 1, 0).ToString('#,##0 MB')}}}, ^
         @{L=' Current Usage'      ;E={;if([string]::IsNullOrWhiteSpace($_.CurrentUsage))      {'-'} else {[Math]::Round($_.CurrentUsage / 1, 0).ToString('#,##0 MB')}}}, ^
         @{L=' Peak Usage'         ;E={;if([string]::IsNullOrWhiteSpace($_.PeakUsage))         {'-'} else {[Math]::Round($_.PeakUsage / 1, 0).ToString('#,##0 MB')}}}, ^
         @{L=' Temporary Pagefile' ;E={;if([string]::IsNullOrWhiteSpace($_.TempPageFile))      {'-'} else {$_.TempPageFile}}}, ^
         @{L=' CIM Class'          ;E={;if([string]::IsNullOrWhiteSpace($_.CimClass))          {'-'} else {$_.CimClass}}}, ^
         @{L=' Status'             ;E={;if([string]::IsNullOrWhiteSpace($_.Status))            {'-'} else {$_.Status}}} ^| ^
    Format-List ^| Out-String -Width 1000).Trim("""`r`n"""); ^
         if ($List.Length) {Write-Host """`n ___ Pagefile(s) - Usage [$Tot] - Sorted by [Name] ___`n`n$List"""} else {exit 1}
    
    echo. & echo ^>Press ANY key to EXIT . . . & pause >nul & Exit
    
    
    

    The above is an extract from my PROJECT: Computer Report - Comprehensive in my signature.

    I hope this helps.
      My Computer


  3. Posts : 14,138
    Win10 Pro and Home, Win11 Pro and Home, Win7, Linux Mint
       #13

    When working with the Virtual Memory/Page file/Swapfile I always have to keep in mind the needs of third-party programs in looking for its default location. Having a small, about a GB, hurts nothing but can help in smoother computing.
      My Computers


 

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

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




Windows 10 Forums