How to find the log filename so can TimeStamp to same place

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Baldrik
Junior Coder
Posts: 24
Joined: Mon Feb 14, 2005 11:11 pm
Location: TA7, UK

How to find the log filename so can TimeStamp to same place

Post by Baldrik » Fri Feb 18, 2005 12:17 pm

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)?

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Feb 18, 2005 2:59 pm

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?
MJT Net Support
[email protected]

Guest

Post by Guest » Fri Feb 18, 2005 5:24 pm

Ask>LOGFILE is %LOGFILE%,ok
shows %LOGFILE% untranslated, not null but still with the %'s.

Direct ans to why the question:
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...
I'm still running from MSched list-of-scripts via rightclick Run. Haven't tried from command line yet, still learning.

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.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Feb 18, 2005 5:27 pm

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.
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts