|
Answer» Hi all,
Within my BATCH script, I need to find out what is the name of the script that is currently running. Reason... I have multiple different batch files that on completion I want to send an email to a different set of recipients. Am using blat with -tf option. The PLAN is to make the -tf file name parameter dynamic based on the name current of the currently running script. eg. Assume I have batch files, JOB_A.BAT, JOB_B.bat etc In each script, I want to execute blat - tf C:\Mail_Recipients\%%.txt .....
Question: How do I find out the name of the currently running batch script while it is executing.Parameter %0 gives you the name of the bat (if you have not used SHIFT)%0 gives the command effectively used to invoke the script. This can vary. The actual script name and extension MAY be ISOLATED in every case as %~nx0 or %~dpnx0 for the full drive, path, name and extension.
|