特別なフォルダー。 リチャード・シダウェイのブログからの翻訳

Windowsの特別なフォルダーの定数のクイックリファレンス。 達成者が必要です。



特別なフォルダー



VBScriptでプログラミングしたとき、「特別なフォルダー」を使用しました。これらは「マイドキュメント」などのフォルダーです。Shell.Applicationオブジェクトを介してアクセスし、目的のフォルダーの定数を渡します。



PowerShellでも同じように機能します

$a = New-Object -ComObject Shell.Application Get-ChildItem $a.NameSpace(0x21).Self.Path
      
      





必要に応じて1行に減らすことができます。

 Get-ChildItem ( (New-Object -ComObject Shell.Application).Namespace(0x21).Self.Path)
      
      







可視性が必要な場合:

 $cookies = 0x21 Get-ChildItem ( (New-Object -ComObject Shell.Application).Namespace($cookies).Self.Path)
      
      







これは、私が自分用に一度作成した特別なフォルダーのリストです。

 $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 $mycomp = 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
      
      







ここに元の記事:

richardspowershellblog.wordpress.com/2008/03/20/special-folders



All Articles