1.
moveFolder
Set objFSO = CreateObject("Scripting.FileSystemObject")
'move folder to destination as subfolder
call objFSO.moveFolder("C:\macro\aa", "C:\macro\aaa\")
'move folder to destination as subfolder
call objFSO.moveFolder("C:\macro\aa", "C:\macro\aaa\")
2.
run.bat
---
@cscript bin\ファイル削除.vbs
@rd /s/q bin
@pause
@del deleteFolder.bat
@rd /s/q bin
@pause
@del deleteFolder.bat
bin\ファイル削除.vbs
----
----
Dim i
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWshShell = WScript.CreateObject("WScript.Shell")
'Get Current Directory path
Set objFolder = objFSO.GetFolder(objWshShell.CurrentDirectory)
GetFile objFolder
Sub GetFile(colSubfolders)
'Delete the subfolder named cvs
' Set colSubfolders = colSubfolders.Subfolders
For Each objSubfolder in colSubfolders.Subfolders
If objSubfolder.Name="CVS" or objSubfolder.Name=".metadata" then
Wscript.Echo objSubfolder.Path
objFSO.DeleteFolder(objSubfolder)
i=i+1
Else
'Wscript.Echo objSubfolder.Name
GetFile objSubfolder
End If
Next
End Sub
Wscript.Echo i & "件のCVSファイルを削除しました。"
0 comments:
发表评论