Checking Page File Location On Remote Computers

by [Published on 25 Nov. 2010 / Last Updated on 31 Oct. 2009]

This article explains how you can check the Pagefile 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


See Also

The Author — Nirmal Sharma

Nirmal Sharma avatar

Nirmal Sharma is a MCSEx3, MCITP and was awarded the Microsoft MVP award in Directory Services and Windows Networking. He specializes in Microsoft Azure, Office 365, Directory Services, Failover Clusters, Hyper-V, PowerShell Scripting and System Center products. Nirmal has been involved with Microsoft Technologies since 1994. In his spare time, he likes to help others and share some of his knowledge by writing tips and articles on various sites and contributing to PowerShell-based Dynamic Packs for www.ITDynamicPacks.Net solutions.

Featured Links