VBScriptでパスからフォルダ構造を作成
パスからフォルダ構造を作成する簡易プログラムを作ってみた。
パスがテキストなどに書いて保存されてあったりして、それをコピーしてといった時のため。
'CreateHierarchyFolder.vbs option explicit dim dpath, dnames, crpath dim fs dim i set fs = wscript.createobject("scripting.filesystemobject") dpath = inputbox("作成するフォルダパスを入力して下さい|^・ω・)", "パスからフォルダ作成") if dpath = "" then wscript.quit dnames = split(dpath, "\") for i = lbound(dnames) to ubound(dnames) if i = 0 then crpath = dnames(i) elseif i > 0 and dnames(i) <> "" then crpath = crpath & "\" & dnames(i) if fs.folderexists(crpath) = false then fs.createfolder crpath end if next set fs = nothing
- 作者: 五十嵐貴之
- 出版社/メーカー: ソシム
- 発売日: 2009/06/01
- メディア: 単行本
- 購入: 1人 クリック: 65回
- この商品を含むブログ (27件) を見る