Pass Variables to bemcmd.exe
Rather than use the "Eject media after job completes" option, each of my backup jobs has a post-command that looks something like this:
"C:\Program Files\Symantec\Backup Exec\bemcmd.exe" -o115 -d"HP 1"
(In case you're wondering, the reason for this is because I have configured this post-command to only run when the job completes successfully, something that I don't think is possible using the Eject checkbox. This allows me to rerun the job remotely if necessary without re-inserting the tape).
My question is this: Is it possible to pass a variable to the command line that will reference the drive name that was used for the job? That is, instead of passing the line above, is there something like
"C:\Program Files\Symantec\Backup Exec\bemcmd.exe" -o115 -d"%DRIVE_NAME%"
that I could specify in all of my jobs, regardless of which drive they use? What I'm doing now works fine until I need to run one of my jobs against a different drive than normal.
Thank you!!
Sorry. I misunderstood your question.
There is no global variable that you can use, but you can use the BEMCMD -o68 switch to enumerate your devices. Parse the output to get the device name of your tape drive and use that to construct the BEMCMD command that you want.