I wanted to program a mapkey to save my current file in my current working directory and in a back up file location. Then purge the curent working directory of all but the latest iteration. Can someone help me with that?
This is a bit tricky, in addition to how to create mapkeys you need to know the function of Backup command.
Creating a mapkey that does the things above is not straight forward as the active file & folder will be changed during backup. The solution will also depend on what you would like to do after using the mapkey?
If you use the backup command twice you can accomplish what he wants. First file > Save As > Backup to the backup location (backup file becomes the active model), then File > Save As > Backup to the working directory (working directory model becomes the active model).
I'd encourage him to think through the ramifications of this:
It's possible, but considering all the possible scenarios and the implications of each is not trivial.
Thanks all! The back up folder will be the same for every project. This sequence works but I would like to purge the working directory of all related files (.frm, .drw, .asm, .prt) except for the latest iteration (.frm I wouldn't need at all in either the working directory or the back up folder). I would be ok with purging every .prt, .asm and .drw of everything but the latest iteration in the working directory. Is there a way to do that?
Yes, but your mapkey would have to activate the system command window, then Pause the mapkey. During the Pause in the command window you would most likely need to change to the directory the files are stored in, then run the Purge command, then exit the command window, and then Resume the mapkey...
right now I have it where it does a save as on the back up directory and then a save as on the current working directory. So I am in the current directory to do the purge. When I have the command window pop up it won't auto enter "purge" I'm assuming because it is system command window is another program. If I pause the mapkey can I somehow auto enter "purge", hit enter and close out the system command window? I don't need to purge the back up directory. I could make it a daily occurrence like Ben was saying with windows batch file.. wouldn't be 100% ideal but I think that would work for what we are trying to do.
Can you give us a more detailed idea of what it is you are trying to accomplish?
Mapkey to save to the current working directory and then save to a fixed backup directory should be easy to do.
The purge requirement becomes the hard part as there are no built-in tools for purging. Speaken Purge utility could be run, but like Joel said, triggering it becomes complicated. Would you need to run the purge immediately or could a windows batch file launch the Purge utility daily, after hours?
You can even try to use the GENIUS TOOLS Purge Tool. I am not sure if there is a Batch Mode implemented right now.
A good try will be using QuickAccess - where you can use a lot of variables in your Mapkeys: