Your technology certification is waiting. Enroll in Cloud Class ®
REM Define base or root directory to work in
REM Loop through all first level folders in base folder1
for /D %%A in ("%BaseDir%\*") do (
REM Loop through each subfolder to the first level folders
for /D %%B in ("%%A\*") do (
REM Move all files from the second level to the first level
move "%%B\*.*" "%%A"
REM Try to remove this second level folder now
Open in new window
The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.
One of a set of tools we're offering as a way of saying thank you for being a part of the community.
sBaseFolder = "c:\temp\base"
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oBaseFolder = oFSO.GetFolder(sBaseFolder)
For Each oSubFolder In oBaseFolder.SubFolders
For Each oSubSubFolder In oSubFolder.SubFolders
oFSO.MoveFile oSubSubFolder & "\*.*", oSubFolder & "\"
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.