精神病について

このエントリーをはてなブックマークに追加
14卵の名無しさん
'ファイルツリー出力
'ファイルツリーをftreeout.txtに出力します。
'最初のダイアログで、ルートにするフォルダを選びます。
Dim sLine,sRootDir,sOutFile
Set Fs = WScript.CreateObject("Scripting.FileSystemObject")
Set Shell = WScript.CreateObject("Shell.Application")
sOutFile="ftreeout.txt"
If WScript.Arguments.Count>0 Then
sRootDir=WScript.Arguments(0)
End If
If Fs.FolderExists(sRootDir) Then
Set oRootDir = Shell.NameSpace(sRootDir)
Else
Set oRootDir = Shell.BrowseForFolder(0,"ルートフォルダの選択",0)
If IsEmpty(oRootDir) Then WScript.Quit
End If
Set ts=Fs.CreateTextFile(sOutFile,True)
ts.WriteLine oRootDir.Title
Search oRootDir.Items.Item 'oRootDir.Self 'Win2000の場合
ts.Close
WScript.Echo "終了"
15卵の名無しさん:05/02/25 06:30:20 ID:UBxCTzko0
Sub Search(obj)
Dim I
I=1
If obj.IsFolder Then
Set oItems=obj.GetFolder.Items
For Each child In oItems
If child.IsFolder Then
tmp= "■" & child.Name
Else
tmp= child.Name
End If

If I=oItems.Count Then
ts.WriteLine sLine & "┗" & tmp
sLine=sLine & " "
Else
ts.WriteLine sLine & "┣" & tmp
sLine=sLine & "┃"
I=I+1
End If
Search child
Next
End If
If Len(sLine)>0 Then
sLine=Left(sLine,Len(sLine)-1)
End If
End Sub
16卵の名無しさん:05/03/03 22:05:31 ID:n1DeakJt0
17卵の名無しさん
|(-_-)|