Checking Page File Location On Remote Computers

There is no any easiest way to check the Pagefile on remote computers. You have to visit each computer individually to check Pagefile location. By default, the Pagefile is stored on the C:\ drive in the default installation. Let's say you have 1000 servers in your environment and are not sure where the Pagefile is stored. You need this data for audit purpose. As a manual process, it may take some considerable amount of time.

You can use the below script to accomplish this:


  • Create a Text File: CompList.TXT
  • Put all the Server names in this file
  • Next, put the following lines in a file and save it as PageLoc.CMD
  • ***START HERE***
  • @ Echo Off 
  • Echo Server Name, Pagefile Location >> Result.CSV
  • FOR /F "Tokens=*" %%L IN (CompList.TXT) DO (
  •     SET ServerName=
  •     SET ServerName=%%L
  •     REG Query \\%%L\HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management /v pagingfiles > StoreOutput.TXT
  •     FOR /F "Tokens=REG_MULTI_SZ" %%N IN (StoreOutput.TXT) DO SET PGLocation=%%P
  •     Echo !ServerName!, !PGLocation! >> Result.CSV
  • )
  • ***END HERE***

The above script queries the registry on each server mentioned in the CompList.TXT and checks the location of Pagefile. The output is saved in Result.CSV in the below format:

  •     Server1   C:\Pagefile
  •     Server2   D:\Pagefile
  •     Server3   E:\Pagefile


About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top