- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to remove pagefile on the specific drive using PowerShell?
In this article, we have a pagefile set on E: (System managed) and we need to remove the pagefile from E: So in the below image once we remove it, the pagefile should be “No Paging File”.
To do so using PowerShell, we need to filter the pagefile on a specific drive and need to run the below code.
$pagefileset = Gwmi win32_pagefilesetting | where{$_.caption -like 'E:*'} $pagefileset.Delete()
You may want to reboot the server after removing pagefile.
To change the above settings on the remote computer, use -ComputerName parameter in the GetWMIObject class.
- Related Articles
- How to remove the mapped network drive using PowerShell?
- How to get pagefile settings using PowerShell?
- How to change Pagefile settings using PowerShell?
- How to change the Drive letter using PowerShell?
- How to map the network drive using PowerShell?
- How to change pagefile settings from custom to system managed using PowerShell?
- How to rename the drive letter in Windows using PowerShell?
- How to remove windows features using PowerShell?
- How to get the specific process(es) information using PowerShell?
- How to copy files of the specific extension using PowerShell?
- How to remove windows folder sharing using PowerShell?
- How to Remove the computer from the AD domain using PowerShell?
- How to delete the specific tag of Azure VM using PowerShell?
- How to delete the specific node from the XML file using PowerShell?
- How to update the specific node of the XML file using PowerShell?

Advertisements