Automatically run a batch file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
BatchMan
Posts: 1
Joined: 26 Jun 2010 20:23

Automatically run a batch file

#1 Post by BatchMan » 26 Jun 2010 20:33

Hi Everyone,
Suppose after creating a text file I go to the file option and select Save As. Then upon selecting the Save As option, a batch file executes and populates the File Name box that pops up with a name that was previously chosen in code, skips a space, and adds the current date. For example if I specified the name MyFile as the file name to be automatically generated and today's date is January 1, 2010, the name of the file will be MyFile 010110 after the batch file executes. Is that possible without having to edit the registry key? Thanks in advance for your help.

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Automatically run a batch file

#2 Post by aGerman » 27 Jun 2010 07:57

Hmm. Idk exactly what you wanna do. You can't fill in a box using batch.
If you would redirect any text to a file (using your batch code) you could simply append the date to a predefined file name. The variable %date% contains the current date. How to assemble the string 010110 depends on the formatting of %date%.

Regards
aGerman

Post Reply