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. CREATEOLEOBJ
  2. Shell.NameSpace
  3. Shell.Folder.Items
  4. Shell.Folder.GetDetailsOf
  5. Shell.FolderItems.Count
  6. Shell.FolderItems.Item
  7. Shell.FolderItem
  8. Shell.FolderItem.Name
  9. Shell.FolderItem.Size
  10. Shell.FolderItem.Type

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

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. CREATEOLEOBJ
  2. Shell.BrowseForFolder
  3. Shell.Folder.Items
  4. Shell.FolderItems.Count
  5. Shell.FolderItems.Item
  6. Shell.FolderItem.Name
  7. Shell.FolderItem.Size
  8. Shell.FolderItem.ModifyDate
  9. Shell.FolderItem.Path
  10. Shell.FolderItem.Type

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

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. CREATEOLEOBJ
  2. Shell.NameSpace
  3. Shell.Folder.Items
  4. Shell.FolderItems.Count
  5. Shell.FolderItems.Item
  6. Shell.FolderItem.IsFileSystem
  7. Shell.FolderItem.Name