.BAT style commands in debugger

.BAT style commands in debugger

Hello again O' Most Helpful People

Not sure if I'm just not searching for the right phrase, here or elsewhere online, but I'm trying to find a way to automatically delete some files from the $(ProjectDir) as a pred-debug event. Currently I am forced to navigate my way to the directory and manually delete the files (the model crashes if either are present), but after doing this about a billion times it's getting old.

Something akin to the Pre-Build Event would be perfect, only "pre-debug" obviously.



3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

There isn't an event that runs on a debug, but I wonder (haven't tried this) if you could replace the "Command" in the Debugging property page with an invocation of a .bat file that does the delete and then runs the EXE? This might not work depending on how the debugger gets control, but it's worth a shot.

Retired 12/31/2016

In the main program insert conditional compilation code that expands in Debug build. This code checks the command line for an option switch, you define the switch (e.g. -deleteFiles). This code could always be present if you want.

Then in the Debug Build, Debug command line options, add your secret switch.

When your program starts it tests for this option, if found, it deletes the files (or changes an open STATUS from OLD/UNKNOWNtoREPLACE).

Jim Dempsey

Leave a Comment

Please sign in to add a comment. Not a member? Join today