:: move /-y "S:\folder1\Document*.txt" "S:\folder1\Documents\txt" :: I think this line is unnecessary forfiles /p "C:\Users\dpoghosy\Desktop\Photos" /s /m *.* /c "cmd /c Del @path" /d -0 IF %ERRORLEVEL%==0 ( set Message="Success Message" exit 0 ) ELSE ( set Message="Error Message" exit 1001 ) @echo %Message%