Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Script file  (Read 1957 times)

0 Members and 1 Guest are viewing this topic.

salism0b

    Topic Starter


    Starter

    Script file
    « on: January 21, 2009, 02:02:37 AM »
    I have a script that runs as per the schedule task on a hourly basis. the sript doesnt run and there is no way to get an alert at the event of failure to run the script. I want to recieve an alert whenever the script file fails to execute. I have an idea to get a log file whenever the script file executes. I will create another batch file that checks for the log file and I believe there can be a way to do this. If the log file is created with the date variable and the new batch file that i plan to create to check the execution of batch file will also check for the date variable file so that i can know that the log file was created for that particular date or infact no need to do by date but once the condition is met we can add a command to delete the log file.

    so the new batch file should see for the log file and if meets the condition then it skips the net send command and goes to command to delete the log file and if the condition fails it goes to net send or any otehr way to send an alert and sends an alert.

    I have explained the whole thing in a not so techincal way. but some one with the knowledge of scripting can understand the problem adn help me.

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: Script file
    « Reply #1 on: January 21, 2009, 07:47:16 AM »
    There might be a couple of things you can do:

    Open Scheduled Tasks
    On the Advanced menu, select Notify Me of Missed Tasks

    Personally, I only seem to get a popup about missed tasks after a boot. This might not be timely enough for you.

    Quote
    I have an idea to get a log file whenever the script file executes. I will create another batch file that checks for the log file and I believe there can be a way to do this. If the log file is created with the date variable and the new batch file that i plan to create to check the execution of batch file will also check for the date variable file so that i can know that the log file was created for that particular date or infact no need to do by date but once the condition is met we can add a command to delete the log file.

    You may be in luck. The scheduler keeps a log (SchedLgU.Txt) in your Windows directory that contains task names, start and end times, and the result. A simple script should be able to process this file and determine the success/failure of your scheduled task.

    Good luck. 8)
    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein

    salism0b

      Topic Starter


      Starter

      Re: Script file
      « Reply #2 on: January 21, 2009, 08:58:02 AM »
      There is no option in advanced to notify in case of task failed. However the log file that u suggest will try to explore that but now i need to get a quick one