Hi
I have a batch script run.bat running with the following command
start /wait c:\*\*\*\doscan.exe c:\scanfolder
how do i delete the item in scanfolder after this command end?
delete c:\scanfolder doesn't seems to work and i want to ensure the process completed then run the delete.
Please advise.
batch script to delete a file after the above process completed
Moderator: DosItHelp
Re: batch script to delete a file after the above process completed
Do you want to delete C:\scanfolder or rather its contents?
This would remove the whole folder:
This would remove the contents:
Steffen
This would remove the whole folder:
Code: Select all
rd /s /q "C:\scanfolder"
This would remove the contents:
Code: Select all
for /d %%i in ("C:\scanfolder\*") do rd /s /q "%%~i"
del /f /q "C:\scanfolder\*.*"
Steffen
Re: batch script to delete a file after the above process completed
Some programs do not respect the wait option. Remove the start command and just run the executable directly. Then delete any files after that.