2010年11月22日月曜日

◆特殊フォルダーの取得

EnvironmentクラスのGetFolderPathメソッドを使うと取得できる。

PS>[environment]::GetFolderPath("desktop")
D:\Desktop
PS>[environment+specialfolder] | Get-Member -MemberType property -Static


   TypeName: System.Environment+SpecialFolder

Name                  MemberType Definition
----                  ---------- ----------
ApplicationData       Property   static System.Environment+SpecialFolder Ap
CommonApplicationData Property   static System.Environment+SpecialFolder Co
CommonProgramFiles    Property   static System.Environment+SpecialFolder Co
Cookies               Property   static System.Environment+SpecialFolder Co
Desktop               Property   static System.Environment+SpecialFolder De
DesktopDirectory      Property   static System.Environment+SpecialFolder De
Favorites             Property   static System.Environment+SpecialFolder Fa
History               Property   static System.Environment+SpecialFolder Hi
InternetCache         Property   static System.Environment+SpecialFolder In
LocalApplicationData  Property   static System.Environment+SpecialFolder Lo
MyComputer            Property   static System.Environment+SpecialFolder My
MyDocuments           Property   static System.Environment+SpecialFolder My
MyMusic               Property   static System.Environment+SpecialFolder My
MyPictures            Property   static System.Environment+SpecialFolder My
Personal              Property   static System.Environment+SpecialFolder Pe
ProgramFiles          Property   static System.Environment+SpecialFolder Pr
Programs              Property   static System.Environment+SpecialFolder Pr
Recent                Property   static System.Environment+SpecialFolder Re
SendTo                Property   static System.Environment+SpecialFolder Se
StartMenu             Property   static System.Environment+SpecialFolder St
Startup               Property   static System.Environment+SpecialFolder St
System                Property   static System.Environment+SpecialFolder Sy
Templates             Property   static System.Environment+SpecialFolder Te

0 件のコメント:

コメントを投稿