Search: Advanced search
Please enter a keyword or ID
Post-Event Triggers That Run Batch Files Do Not Work
Post-event triggers which run batch files that redirect output from sscm commands to a log file do not work if multiple files cause the trigger to fire. The log file only includes output from the first sscm command.
Post-event triggers that run scripts start multiple processes that may attempt to write to the log file at the same time. Only the first process completes successfully because of log file access conflicts.
Send the sscm command output for each affected file to a temporary file, append each temporary file to the log file, and then delete the temporary file.
In the following batch file example, the sscm get command copies each file affected by the trigger to the C:\test directory. The get command output is redirected to the temporary file in the C:\test directory. The temporary file is appended to the C:\test\SCMLogfile.txt log file and then deleted.