none
Writing showmessage promt to a log RRS feed

  • Question

  • Hello,

    I am modyfiying a vbs script and there is a line that comes in the script that says script is completed.  It is because of the code below in the script:

    'Notify user script completed
    ShowMessage ("Script Completed" & vbCRLF & vbCRLF & "All activities of this script have been logged to " & sLogFile)

    I know I can take out these lines to avoid the prompt, however what I want to do is instead of showing message on the screen, I want to write the same message to the log file which is sLogFile I believe.  Can someone help?


    Adam

    Friday, September 12, 2014 1:57 PM

Answers

  • Thanks for all the beautiful answers.  For anyone in future, here is a precise answer to the problem:

    Instead of ShowMessage, try LogEvent

    Before

    ShowMessage ("Script Completed" & vbCRLF & vbCRLF & "All activities of this script have been logged to " & sLogFile)

    After

    LogEvent ("Script Completed" & vbCRLF & vbCRLF & "All activities of this script have been logged to " & sLogFile)


    Adam

    • Marked as answer by Adamster Friday, September 12, 2014 5:28 PM
    Friday, September 12, 2014 5:28 PM

All replies