DosTips.com

A Forum all about DOS Batch
It is currently 20 Aug 2017 22:45

All times are UTC-06:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 01 Feb 2017 20:44 
Offline

Joined: 01 Feb 2017 20:26
Posts: 1
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.


Top
   
PostPosted: 02 Feb 2017 02:42 
Offline
Expert

Joined: 22 Jan 2010 18:01
Posts: 2761
Location: Germany
Do you want to delete C:\scanfolder or rather its contents?

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


Top
   
PostPosted: 02 Feb 2017 07:26 
Offline
Expert

Joined: 23 Dec 2011 13:59
Posts: 3509
Some programs do not respect the wait option. Remove the start command and just run the executable directly. Then delete any files after that.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC-06:00


Who is online

Users browsing this forum: Bing [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited