Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. strConfirm = InputBox("Are you sure you want to proceed?" & Chr(13) & Chr(13) & "Enter Yes to proceed", _
  2. "Confirmation", "No")
  3.  
  4. If strConfirm = "Yes" Then
  5. Set objFSO = CreateObject("Scripting.FileSystemObject")
  6.  
  7. objStartFolder = ".\"
  8. ShowSubFolders objFSO.GetFolder(objStartFolder)
  9. WScript.echo "Finished"
  10. Else
  11. WScript.echo "Cancelled"
  12. End If
  13.  
  14. Sub ShowSubFolders(Folder)
  15. For Each Subfolder in Folder.SubFolders
  16. Set objFolder = objFSO.GetFolder(Subfolder.Path)
  17. Set colFiles = objFolder.Files
  18.  
  19. If Not objFSO.FileExists(objFolder & "\" & "folder.jpg") Then
  20. For Each objFile in colFiles
  21. objFSO.MoveFile objFolder & "\" & objFile.Name, objFolder & "\" & "folder.jpg"
  22. Exit For
  23. Next
  24. End If
  25.  
  26. ShowSubFolders Subfolder
  27. Next
  28. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement