Automatically execute a batch file upon selecting the Save As option
-
Hi All, Is there a way to automatically execute a batch file upon selecting the Save As option? What I'm trying to do is I'm trying to prefill the File Name box using a batch file. Suppose after creating a text file I go to the file option and select Save As. Upon selecting the Save As option, the batch file executes and populates the File Name box that pops up with a name that was predefined, skips a space, and adds the current date to the end of the file name. For example if I specified the file name to be automatically generated as MyFile and today's date is January 1, 2010, after the batch file executes, the name of the file will be MyFile 010110. Thanks in advance for your help.
-
Hi All, Is there a way to automatically execute a batch file upon selecting the Save As option? What I'm trying to do is I'm trying to prefill the File Name box using a batch file. Suppose after creating a text file I go to the file option and select Save As. Upon selecting the Save As option, the batch file executes and populates the File Name box that pops up with a name that was predefined, skips a space, and adds the current date to the end of the file name. For example if I specified the file name to be automatically generated as MyFile and today's date is January 1, 2010, after the batch file executes, the name of the file will be MyFile 010110. Thanks in advance for your help.
If you're talking about doing this in any app, then no, you can't. There is no special event that says a FileSave dialog is going to show up and no way a batch file can supply or alter the information (file list) that the dialog displays. What you're talking about has to be written into the application that you're trying to modify.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
If you're talking about doing this in any app, then no, you can't. There is no special event that says a FileSave dialog is going to show up and no way a batch file can supply or alter the information (file list) that the dialog displays. What you're talking about has to be written into the application that you're trying to modify.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...Or... use AutoHotkey[^] to write a shortcut, so you can press a combination on your keyboard, and have it automatically fill it out. Quite a handy tool, you'll want to read the manual though. Bloody good idea. I've got a script set up with a quick hotkey to bring the script up in the editor, and one to refresh the script, allowing very quick changes. Awesome stuff! :)