INTELLIGENT.TECHNICAL.ARCHITECTURE.TRAINING

 
 
Blogs:
 
 

Removing Duplicate Entries from %PATH%

Mark

June 30, 2012 / No Comment
AUTHOR:
CATEGORY: PowerShell, Windows


As developers, we frequently end up with duplicate entries in our path. From the command line you can clean up your path using pathman.exe. Here’s a PowerShell Script to find the duplicates and remove them using Pathman.exe:

$extraPath=(($path.Split("`;") | group | ?{$_.Count -gt 1}).Values | %{$_[0]}
pathman.exe /ru $extrapath

Disclaimer: Works for us.


Leave a Reply

Your Name:
Your Email Adress:
Your comment:

 

IntelliTect Corporation
3024 S. Bannen Ct.
Spokane Valley, WA  99037

Phone: (509) 720-8842
Email: info@intelliTect.com

  COPYRIGHT © 2006-2012 INTELLITECT. ALL RIGHTS RESERVED.