Idera nSoftware Compellent

Finding System Folders

When you automate file system tasks, you may want to know where special folders such as MyPictures or Documents are located. The .NET class Environment provides a static method named GetFolderPath() which provides this information. To find the location of your desktop, use this:

[Environment]::GetFolderPath('Desktop')

If you need to find out the short names of other important system folders, you can simply specify anything else, any you will receive a red error message that lists all of the legal short names:

[Environment]::GetFolderPath('give me more!')

Posted Nov 26 2008, 08:00 AM by ps1

Comments

Mats codemix » Windows Special folders in powershell wrote Mats codemix » Windows Special folders in powershell
on 11-09-2009 2:04 AM

Pingback from  Mats codemix  » Windows Special folders in powershell

Copyright 2010 PowerShell.com. All rights reserved.