Media Creation failed with error message: ‘The directory is not empty’.
Refer to Create TsMedia.log file to find more details.
You will get above error MSG when you are creating an offline media for a task sequence.
If you refer to the TsMedia.log file, you can see information which refers to a temp location which doesn’t exist on the local machine. Most likely you see this behaviour when you have logged in to a machine with a local administrator account, then you launch the SCCM console using Run as different user, where this user never logged on this machine before.
To resolve this issue, logout from the machine and re-login with the user which used to run the SCCM Console then run the Create Task Sequence Media Wizard.