Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a cost of having too many folder paths in the folder variable?
I mean as you keep on adding paths in to your System Path Environment variable, Is it going to cause Powershell to load slightly slower than before?

If it is going to have a performance cost, what is the alternative to adding a ton of folder paths in a single PATH variable?

share|improve this question
    
How many folders are you talking about? Hundreds or even more? –  drew010 Nov 26 '11 at 18:39

1 Answer 1

up vote 0 down vote accepted

Not sure why you are doing this in the first place.

For Powershell, there is no need to load up the PATH variable when you can use profiles and aliases. The performance cost is the prompt having to search each folder when it looks for commands.

Then there is a practicality cost. Path is a global variable. Why use it to solve something that is only used by Powershell and the console? A global solution to a local problem generally leads to unforseen consequences.

Another unintended consequence is if you mistype a command and the system ends up launching a file from outside your working directory. It is just a pain in the rear and also a security vulnerability.

Edit:

BTW, while the OS has a limit of 32,767 for the PATH variable, the Command Prompt has a much much shorter length, somewhere around 2,000. I don't know the exact numnber.

share|improve this answer
    
i think aliases is just what i wanted. I have also thought of having separate consoles for separate purposes. thereby, reducing the chance that i might end up launching a file outside the current directory –  Prasanth Nov 26 '11 at 19:24
    
Aliases and profiles are heavily underused by console users. Especially considering Powershell emulates all the other console commands. –  surfasb Nov 27 '11 at 3:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.