Option Explicit
Dim objFileSys, strScriptPath , str_path
Dim strFilePath, objFile,str_from ,str_to
Dim i , FileName, picName, picNo, newName
Set objFileSys = CreateObject(“Scripting.FileSystemObject”)
strScriptPath = Replace(WScript.ScriptFullName,WScript.ScriptName,””)
picName = “gochiso0”
picNo = “01”
If Not objFileSys.FolderExists(“.\page” & picNo) Then
str_path = objFileSys.CreateFolder(“.\page” & picNo) & “\” ‘フォルダ作成
else
str_path =”.\page” & picNo & “\”
end if
for i=1 to 4
if i > 2 then
FileName = picName & picNo & “_r2_c” & i-2 & “.png”
newName = picName & picNo & “_1_” & i-2 & “-2.png”
str_from = strScriptPath & FileName ‘古いパスと名前
str_to = str_path & newName ‘新しいパスと名前
else
FileName = picName & picNo & “_r1_c” & i & “.png”
newName = picName & picNo & “_1_” & i & “-1.png”
str_from = strScriptPath & FileName ‘古いパスと名前
str_to = str_path & newName ‘新しいパスと名前
end if
Call objFileSys.MoveFile(str_from, str_to)’ファイル名を変更して移動する
next
Set objFile = Nothing
Set objFileSys = Nothing