Special folder. Translation from Richard Siddaway''s Blog
a quick reference of constants for special folders in windows. must have powershielding.
/ > Special folders
When I programmed in VBScript I used the "special folder" are folders of type "my documents" and the like, I used to access through the object's Shell.Application passing it the constant correct folders.
the same way works in PowerShell
the
can be shortened to one line if you like more:
the
And if you want clarity, then:
the
This is the list of special folders which I did once for myself.
the
the original article here:
richardspowershellblog.wordpress.com/2008/03/20/special-folders
Article based on information from habrahabr.ru
/ > Special folders
When I programmed in VBScript I used the "special folder" are folders of type "my documents" and the like, I used to access through the object's Shell.Application passing it the constant correct folders.
the same way works in PowerShell
the
$a = New-Object -ComObject Shell.Application
Get-ChildItem $a.NameSpace(0x21).Self.Path
can be shortened to one line if you like more:
the
Get-ChildItem ( (New-Object -ComObject Shell.Application).Namespace(0x21).Self.Path)
And if you want clarity, then:
the
$cookies = 0x21
Get-ChildItem ( (New-Object -ComObject Shell.Application).Namespace($cookies).Self.Path)
This is the list of special folders which I did once for myself.
the
$ie = 0x1 # Internet Explorer
$progs = 0x2 # Programs
$cp = 0x3 # Control Panel
$printers = 0x4 # Printers and Faxes
$mydocs = 0x5 # My Documents
$favs = 0x6 # Favorites
$startup = 0x7 # Startup
$myrecdocs = 0x8 # My Recent Documents
$sendto = 0x9 # SendTo
$recycle = 0xa # Recycle Bin
$start = 0xb # Start Menu
$music = 0xd # My Music
$videos = 0xe # My Videos
$desktop = 0x10 # Desktop
$mypcname = 0x11 # My Computer
$mynet = 0x12 # My Network Places
$nethood = 0x13 # NetHood
$fonts = 0x14 # Fonts
$templates = 0x15 # Templates
$allsm = 0x16 # All Users Start Menu
$allprogs = 0x17 # All Users Programs
$allstart = 0x18 # All Users Startup
$alldesk = 0x19 # All Users Desktop
$appdata = 0x1a # Application Data
$printhood = 0x1b # PrintHood
$lsapps = 0x1c # Local SettingsApplication Data
$lstempie = 0x20 # Local Settings Temporary Internet Files
$cookies = 0x21 # Cookies
$lshist = 0x22 # Local SettingsHistory
$allappdata = 0x23 # All Users Application Data
$windows = 0x24 # Windows
$system32 = 0x25 # System32
$progfiles = 0x26 # Program Files
$mypics = 0x27 # My Pictures
$profile = 0x28 # User Profile
$common = 0x2b # Common Files
$alltemplates = 0x2e # All Users Templates
$admintools = 0x2f # Administrative Tools
$netconn = 0x31 # Network Connections
the original article here:
richardspowershellblog.wordpress.com/2008/03/20/special-folders
Комментарии
Отправить комментарий