Powershell - Special Folders

Details

Since there is no real environment variable for special folder paths, such as the desktop, home drive and printer environment, powershell is a great alternative to show those paths nonetheless.

Below are some examples how to show some of the special folders:

 

Desktop (local)

 

powershell (new-object -com WScript.Shell).SpecialFolders.item(0)

 

Start Menu - All Users (1) - Specific User (11) 

 

powershell (new-object -com WScript.Shell).SpecialFolders.item(1)
powershell (new-object -com WScript.Shell).SpecialFolders.item(11)



Start Menu Programs - All Users (2) - Specific User (17)

 

powershell (new-object -com WScript.Shell).SpecialFolders.item(2)

powershell (new-object -com WScript.Shell).SpecialFolders.item(17)

 

Autorun - All Users (3) - Specific User (14) 

 

powershell (new-object -com WScript.Shell).SpecialFolders.item(3)

powershell (new-object -com WScript.Shell).SpecialFolders.item(14)

 

Desktop (domain)  - All Users (4) - Specific User (10)

 

powershell (new-object -com WScript.Shell).SpecialFolders.item(4)

powershell (new-object -com WScript.Shell).SpecialFolders.item(10)

 

Application data 

 

powershell (new-object -com WScript.Shell).SpecialFolders.item(5)

 

Printer environment 

 

powershell (new-object -com WScript.Shell).SpecialFolders.item(6)

 

Templates 

 

powershell (new-object -com WScript.Shell).SpecialFolders.item(7)

 

Fonts 

 

powershell (new-object -com WScript.Shell).SpecialFolders.item(8)

 

Network environment 

 

powershell (new-object -com WScript.Shell).SpecialFolders.item(9)

 

SendTo 

 

powershell (new-object -com WScript.Shell).SpecialFolders.item(12)

 

Recent 

 

	powershell (new-object -com WScript.Shell).SpecialFolders.item(13)

	 

Favorites 

 

powershell (new-object -com WScript.Shell).SpecialFolders.item(15)

 

Home Drive 

 

powershell (new-object -com WScript.Shell).SpecialFolders.item(16)