Name

アイテムの名前を設定または取得します。

構文
strName = FolderItem.Name
引数
戻値
指定したアイテムの名前

プログラム実行例

デスクトップのファイル一覧

CONST ssfDESKTOP = 0

HASHTBL iColumn

DIM Shell = CREATEOLEOBJ("Shell.Application")
DIM Folder = Shell.NameSpace(ssfDESKTOP)
DIM FolderItems = Folder.Items

FOR n = 0 TO 350
	iColumn[Folder.GetDetailsOf(EMPTYPARAM, n)] = n
NEXT

FOR n = 0 TO FolderItems.Count - 1
	DIM FolderItem = FolderItems.Item(n)
	WITH FolderItem
		PRINT .Name
		PRINT .Size + " Byte"
		PRINT .Type
	ENDWITH
	PRINT "-----"
NEXT
  1. script.function.CREATEOLEOBJ(5)
  2. com.Shell.NameSpace(6)
  3. com.Shell.Folder.Items(7)
  4. com.Shell.Folder.GetDetailsOf(10)
  5. com.Shell.FolderItems.Count(13)
  6. com.Shell.FolderItems.Item(14)
  7. com.Shell.FolderItem(15)
  8. com.Shell.FolderItem.Name(16)
  9. com.Shell.FolderItem.Size(17)
  10. com.Shell.FolderItem.Type(18)

指定したディレクトリ内のフォルダ・ファイル情報を取得

CONST ssfDesktop = 0

DIM Shell = CREATEOLEOBJ("Shell.Application")
DIM Folder = Shell.BrowseForFolder(0, "フォルダを選択してください。", 0, ssfDesktop)

FOR n = 0 TO Folder.Items.Count - 1
	DIM FolderItem = Folder.Items.Item(n)
	WITH FolderItem
		PRINT "名前<#TAB><#TAB>" + .Name
		PRINT "サイズ<#TAB><#TAB>" + .Size + " Byte"
		PRINT "更新日時<#TAB>" + .ModifyDate
		PRINT "パス<#TAB><#TAB>" + .Path
		PRINT "種類<#TAB><#TAB>" + .Type
	ENDWITH
	PRINT "----------"
NEXT
  1. script.function.CREATEOLEOBJ(3)
  2. com.Shell.BrowseForFolder(4)
  3. com.Shell.Folder.Items(6)
  4. com.Shell.FolderItems.Count(6)
  5. com.Shell.FolderItems.Item(7)
  6. com.Shell.FolderItem.Name(9)
  7. com.Shell.FolderItem.Size(10)
  8. com.Shell.FolderItem.ModifyDate(11)
  9. com.Shell.FolderItem.Path(12)
  10. com.Shell.FolderItem.Type(13)

ファイルシステムかどうか

DIM Shell = CREATEOLEOBJ("Shell.Application")
DIM Folder = Shell.NameSpace("C:\Windows")
DIM FolderItems = Folder.Items

FOR n = 0 TO FolderItems.Count - 1
	DIM FolderItem = FolderItems.Item(n)
	WITH FolderItem
		PRINT .IsFileSystem + "<#TAB>" + .Name
	ENDWITH
NEXT
  1. script.function.CREATEOLEOBJ(1)
  2. com.Shell.NameSpace(2)
  3. com.Shell.Folder.Items(3)
  4. com.Shell.FolderItems.Count(5)
  5. com.Shell.FolderItems.Item(6)
  6. com.Shell.FolderItem.IsFileSystem(8)
  7. com.Shell.FolderItem.Name(8)