01.
Set
Shell = CreateObject(
"Shell.Application"
)
02.
03.
Set
objFolder = Shell.BrowseForFolder( 0,
"フォルダ選択"
, 11, 0 )
04.
05.
if objFolder is nothing then
06.
WScript.Quit
07.
end if
08.
if not objFolder.Self.IsFileSystem then
09.
WScript.Echo
"ファイルシステムではありません"
10.
WScript.Quit
11.
end if
12.
13.
WScript.Echo objFolder.Self.Path
14.
15.
strItems =
""
16.
17.
18.
Set
objFolderItems = objFolder.Items()
19.
20.
21.
nFiles = objFolderItems.Count
22.
For
I = 0 to nFiles - 1
23.
Set
objItem = objFolderItems.Item(I)
24.
if objItem.isFolder then
25.
strItems = strItems & objItem.Name &
" [Folder]"
& vbCrLf
26.
else
27.
strItems = strItems & objItem.Name & vbCrLf
28.
end if
29.
Next
30.
31.
32.
WScript.Echo strItems