Link to home
Start Free TrialLog in
Avatar of Charlie_Melega
Charlie_Melega

asked on

DOS Command syntax validation

Hello,

I have an application that I load via a command line syntax. This application will write debug output to a file and when this file hits 300k, will open the next file incrementing the filename by 1. What I am looking to do via DOS is to delete the original file, file1 and file2 as soon as file2 is opened. That’s it. I don’t want more than 2 files at a time as these file can get large and I don’t want to chew up resources. I am simply trying to figure out how to use DOS to delete these 3 files ONCE File2 is opened.

Thank You
Avatar of jimbecher
jimbecher
Flag of United States of America image

if not exist file2 goto done:
del file0
del file1
:done
 
Avatar of Gerwin Jansen
Will the application open file3, file4, file5 and so on?
ASKER CERTIFIED SOLUTION
Avatar of jimbecher
jimbecher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Charlie_Melega
Charlie_Melega

ASKER


just to clarify,  I am running ProcMon using the following syntax:

procmon /Quiet /LoadConfig TEST_config  /Minimized /BackingFile FILE.PML

this will load ProcMon with the specific config file and stat writing output to FILE.PML. After the file reached approximately 300k in size, it will close and open FILE1.PML and so on. Once FILE2 opens, I  want to delete all instances of FILE.* . I just tested this manually and cannot delete FILE and FILE1 even though both of these files are closed, ProcMon has a lock on them and tey cannot be deleted. Obviously, this is more of a problem with ProcMon I have to deal with than DOS syntax so I will need to re-think this. If anyone has thoughts, I'd welcome them.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial