![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Issue with Windows Task Schedular Dear All, I want to write a Script for setting up a Windows Task Schedular such that it runs everyday after 1 hour. I tried using Sleep but it does not work in Windows Server 2003 environment. Can anyone suggest me something? Kind Regards, Muhammad Nasir Waqar |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Issue with Windows Task Schedular "Muhammad Nasir Waqar" <nasir@xxxxxx> wrote in message news:OHroINq3JHA.1864@xxxxxx Quote: > Dear All, > > I want to write a Script for setting up a Windows Task Schedular such that > it runs everyday after 1 hour. > > I tried using Sleep but it does not work in Windows Server 2003 > environment. Can anyone suggest me something? > > Kind Regards, > Muhammad Nasir Waqar wish to automate the process then you could embed schedtask.exe in a batch file (easy) or invoke it with the Run method in a VB Script (less easy). The Sleep method works very well under Windows Server 2003. If it does not work for you then let's have a look at your script. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Issue with Windows Task Schedular I am Sorry for wrong posting. I intially wrote the following script with help from Microsoft site.. strComputer = "." Set objService = GetObject("winmgmts:\\" & strComputer) Set objNewJob = objService.Get("Win32_ScheduledJob") errJobCreated = objNewJob.Create ("notepad.exe", "********123000.000000-420", True , 1 , , , JobID) This script was solving my issue of creating a Scheduled Task but was not allowing me to run it daily after every hour. Then, I wrote another following script: Set WshShell = WScript.CreateObject("WScript.Shell") i=1 do while i<11 msgbox i WshShell.Run "notepad.exe" WshShell.sleep 6000 i=i+1 loop This script solves my problem but sleep is not working. Please help. Kind Regards, Muhammad Nasir Waqar "Pegasus [MVP]" <news@xxxxxx> wrote in message news:enp5Qkq3JHA.4272@xxxxxx Quote: > > "Muhammad Nasir Waqar" <nasir@xxxxxx> wrote in message > news:OHroINq3JHA.1864@xxxxxx Quote: >> Dear All, >> >> I want to write a Script for setting up a Windows Task Schedular such >> that it runs everyday after 1 hour. >> >> I tried using Sleep but it does not work in Windows Server 2003 >> environment. Can anyone suggest me something? >> >> Kind Regards, >> Muhammad Nasir Waqar > The easiest way to create a scheduled task is to use schtasks.exe. If you > wish to automate the process then you could embed schedtask.exe in a batch > file (easy) or invoke it with the Run method in a VB Script (less easy). > > The Sleep method works very well under Windows Server 2003. If it does not > work for you then let's have a look at your script. > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Issue with Windows Task Schedular Muhammad Nasir Waqar schrieb: Quote: > I am Sorry for wrong posting. Quote: > Set WshShell = WScript.CreateObject("WScript.Shell") > i=1 > do while i<11 > msgbox i > WshShell.Run "notepad.exe" > WshShell.sleep 6000 Quote: > i=i+1 > loop > > This script solves my problem but sleep is not working. |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Issue with Windows Task Schedular Thanks alot. This solved my problem. "ekkehard.horner" <ekkehard.horner@xxxxxx> wrote in message news:4a1d2f8b$0$31332$9b4e6d93@xxxxxx-online.net... Quote: > Muhammad Nasir Waqar schrieb: Quote: >> I am Sorry for wrong posting. Quote: >> Set WshShell = WScript.CreateObject("WScript.Shell") >> i=1 >> do while i<11 >> msgbox i >> WshShell.Run "notepad.exe" >> WshShell.sleep 6000 Quote: >> i=i+1 >> loop >> >> This script solves my problem but sleep is not working. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Configurable Windows Task Schedular | .NET General | |||
| Task Schedular | Software | |||
| Task Schedular and Access | Vista General | |||
| stopping task schedular | Vista General | |||
| Task Schedular problem | Vista performance & maintenance | |||