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:

Steps:

  • 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

 

Featured Links