Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to avoid multiple persistent CMD instances called from loop inside .BAT script ?

Status
Not open for further replies.

andre_luis

Super Moderator
Staff member
Advanced Member level 7
Joined
Nov 7, 2006
Messages
9,642
Helped
1,191
Reputation
2,401
Reaction score
1,218
Trophy points
1,403
Location
Brazil
Activity points
55,930
I was trying to quicly solve an issue we have at the local file server where surveilance pictures are temporarily stored before being issued to central server. The problem is that the software that capture images ( that we don't have its source code ) sometimes store a picture with wrong format and extension, precisely with the same name pattern, let's say FILE1 or FILE2.

The following code was added to an existing watchguard .BAT script and works well on this regard, removing the extraneous files whereever it hapens.

However, a distinct CMD window is oppened each time the DEL command is executed:

Code:
:ERASEPIC
if exist "<PATH><FILE1>" DEL "<PATH><FILE1>"
if exist "<PATH><FILE2>" DEL "<PATH><FILE2>"
timeout 3600
goto ERASEPIC

Does someone know how to turn around that ?
In other word, we wanted to have the just oppened window closed as soon as command were executed.


( Side note: Both these 2 files are not correctly encoded with the Jpeg format, and lock issuing further pictures to central server )
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top