Announcement

Collapse
No announcement yet.

log entries related to VBS script

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • log entries related to VBS script

    Hi all,

    I have a scheduled job which is calling a .cmd file where i have given some .vbs script file which will run in the command prompt

    while that job is running it is giving the output result as code (1), which means that the job finished unsuccessfully

    so, now i wanted to know whether there are any log entries being logged when those scripts run in the command prompt

    that means when the job runs, that in-turn calls that particular .cmd file and whatever the .vbs script file names are given that files will run with the command "wscript <file name.vbs>"

    so this .vbs files are not running properly and the result of the job is code (1)

    For this reason, i want to check whether there will be any entry of whether that .vbs script file is ran or not..........!!!!!!!!!


    if any body knows about this please give me the reply for this topic, it is very needful for me pls.................

    thanks
    aju

  • #2
    Re: log entries related to VBS script

    You could create a processmonitor (with vbs) that tracks the starting or the ending of any wscript.exe process on the computer,
    but I think it is easier to add a part at the beginning of the code of your existing vbscript, that it will create a little file (a flag) on the computer (with or w/out content) the moment the vbscript is executed. Then, the existence of the little file indicate whether the vbscript was started or not.
    (additionaly, when you begin the vbscript with the line On Error Resume Next, then it is also possible to add code to the end of the script that will write the last Err.Number and Err.Description if there where any, as output to that little check file)

    Note, that you cannot use the existing mapped drives when running the script as a Task or when using Runas! And that the runas-'user' must have sufficient rights to all the resources that are used in the script.

    Can you show the batch and vbscript?


    \Rems
    Last edited by Rems; 7th January 2008, 21:54.

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment


    • #3
      Re: log entries related to VBS script

      HI Rems,

      Thank you for your response

      I have the .vbs script which will get the data from the database and upload it to the FTP site

      can u provide me the details, is there any default location we can find the logs of the scripts whether are running or not

      or can u tell me how can we add some more script so that it will create a log for that particular script is failed or started successfully

      thanks
      raj

      Comment


      • #4
        Re: log entries related to VBS script

        The only reason for the vbs not being executed et all, would be when it is not being executed right. That is why you have to focus on your batch, or how the batch is runned as a task. Can you give more details.

        Add the lines below to the batch that is excecuting the vbscript, place them right after the line where the vbscript is being started

        Code:
        if errorlevel 1 (
        If not exist "c:\$$$$test" md "c:\$$$$test"
        >"c:\$$$$test\startvbs.log" echo.wscript returned %errorlevel%
        )
        When an error occour on the script, the batch create a folder and logfile in it. When the logfile is created, that indicates there was an error. Open the log and get the error number.

        \Rems

        This posting is provided "AS IS" with no warranties, and confers no rights.

        __________________

        ** Remember to give credit where credit's due **
        and leave Reputation Points for meaningful posts

        Comment

        Working...
        X