MoveFolder
フォルダ移動
文法
FileSystemObjectオブジェクト.MoveFolder From, To
パラメータ
From : 移動元フォルダ名
To : 移動先フォルダ
機能説明
フォルダを移動
パスの指定は「C:\Inetpub\wwwroot\」のように〜\までを指定
フォルダ名までの指定だとフォルダ名を変更して移動します。
使用例
<%
Dim objFs, objFld, objFlCol
Set objFs = Server.CreateObject("Scripting.FileSystemObject")
objFs.MoveFolder "D:\test", "D:\test2\"
Set objFld = objFs.GetFolder("D:\test")
Set objFlCol = objFld.Files
Response.Write "移動元
" & vbCrlf
For Each i in objFlCol
Response.Write i.Name & "
" & vbCrlf
Next
Set objFld = objFs.GetFolder("D:\test2\test")
Set objFlCol = objFld.Files
Response.Write "移動先
" & vbCrlf
For Each i in objFlCol
Response.Write i.Name & "
" & vbCrlf
Next
'オブジェクトを開放
Set objFld = Nothing
Set objFlCol = Nothing
Set objFs = Nothing
%>
Topへ