How to find the log filename so can TimeStamp to same place
Moderators: Dorian (MJT support), JRL
How to find the log filename so can TimeStamp to same place
I couldn't see a system variable for this in the manual, so would the only current way be to drive the MSched gui and use GetWindowText (or use manual methods)?
In the case of scripts run from the command line the log file is in the variable LOGFILE that is passed on the command line. See command line options in help file.
If running scripts from inside Macro Scheduler you'd already know the log file name since you've set it up with the script.
Can I ask why you need the script to determine what it's log file is?
If running scripts from inside Macro Scheduler you'd already know the log file name since you've set it up with the script.
Can I ask why you need the script to determine what it's log file is?
MJT Net Support
[email protected]
[email protected]
Ask>LOGFILE is %LOGFILE%,ok
shows %LOGFILE% untranslated, not null but still with the %'s.
Direct ans to why the question:
You're right I know the log file name I set up in the script definition, but I thought it would be better for the script to know without me telling it independently, so I don't have to remember to change the filename on TimeStamp debugging lines in future if I (or someone else) alters the log file destination in the script definition, maybe after they've copied the script source to another system.
shows %LOGFILE% untranslated, not null but still with the %'s.
Direct ans to why the question:
I'm still running from MSched list-of-scripts via rightclick Run. Haven't tried from command line yet, still learning.support - Thu Feb 17, 2005 1:04 pm - Message prevents later ModalMessage waiting for ok click
...Have TimeStamp log to the same file that you set up in logging. This is by far the best debug aid in my opinion...
You're right I know the log file name I set up in the script definition, but I thought it would be better for the script to know without me telling it independently, so I don't have to remember to change the filename on TimeStamp debugging lines in future if I (or someone else) alters the log file destination in the script definition, maybe after they've copied the script source to another system.
If you run the script with:
msched.exe scriptfile.scp /LOGFILE=d:\log.txt
Then %LOGFILE% will show up in the script and it will use log.txt to log the script.
Timestamp can use any file - doesn't have to be the script's log file. So if you're only interested in logging your own debug output, then it isn't an issue what the script's log file is.
msched.exe scriptfile.scp /LOGFILE=d:\log.txt
Then %LOGFILE% will show up in the script and it will use log.txt to log the script.
Timestamp can use any file - doesn't have to be the script's log file. So if you're only interested in logging your own debug output, then it isn't an issue what the script's log file is.
MJT Net Support
[email protected]
[email protected]