I'm trying to determine how a script was launched then run a sub based on this.
For example, if a script was launched by Task Scheduler then write a line into a log file saying 'scheduled launch' but if it was run manually then write a different line into the log file saying 'manual launch'.
The only part I need help with is determining how the script was launched, and I really have no idea how to do that.
If there's no flags I can check, then I'm thinking of adding an argument to the scheduled task and do a check like:
if args > 0 then SubX else SubY
Any thoughts or suggestions would be appreciated!
Thanks,
h
For example, if a script was launched by Task Scheduler then write a line into a log file saying 'scheduled launch' but if it was run manually then write a different line into the log file saying 'manual launch'.
The only part I need help with is determining how the script was launched, and I really have no idea how to do that.
If there's no flags I can check, then I'm thinking of adding an argument to the scheduled task and do a check like:
if args > 0 then SubX else SubY
Any thoughts or suggestions would be appreciated!
Thanks,
h