Tag Info

Hot answers tagged

46

Congratulations! You've come up against a problem that has stumped many a Windows user/admin. No, you cannot rename a task except for exporting, renaming and importing again. Yes, it's rather silly. Perhaps an enterprising scripter could create a simple PowerShell script that automates this, but until then, you're stuck with your export/import two-step. ...


11

I have no authoritative reference but I have just tested the behavior of multiple different Stop conditions in Task Scheduler on both Windows 8.1, Server 2008 R2 and 2012 R2. They both apply! Whichever stop condition is met first, stops the task The "Stop task if it runs longer than"-condition speficied in the Trigger, will only apply when the task has ...


5

Server 2012 R2 and Windows 8.1 have Task Scheduler cmdlets, and this module can be copied and used on a Windows 7 machine, presumably it probably needs the latest .NET and the Windows Management Framework as well. I'm able to disable and re-enable scheduled tasks, as well as display task information. Currently I don't know of built-in cmdlets that give me ...


5

Nope. Microsoft built a better mousetrap and you will need to start using it. schtasks.exe replaces at.exe. at.exe is deprecated. From here: Schtasks replaces At.exe, a tool included in previous versions of Windows. Although At.exe is still included in the Windows Server 2003 family, schtasks is the recommended command-line task scheduling tool And ...


5

I believe that return code is a generic .NET console app crashed code. The way the job is set up in Task Scheduler is not causing this issue. Check the Application event log on the server for any errors that occurred near the time the job 'completed'. Those events should give you more information as to why the job exited abnormally, so you have some idea ...


5

You can certainly do this using Powershell and WMI Events. Here's a link that describes setting up PowerShell to monitor events. http://www.pavleck.net/powershell-cookbook/ch31.html Here's a link that describes the kind of events you'll be looking for: ...


5

I'd highly suggest not doing this. If your server is so heavily loaded that apache isn't getting the CPU time it needs, then renicing a process will have a very minimal effect, if any. Additionally, apache will have many different processes running at any one time. You could renice the parent process, and its children will inherit the parent's niceness, but ...


5

I believe you're looking for cron.


4

you have two options for running this task one is if somebodies logged in and one is run whether somebodys logged in or not. I'd just switch the task to must be logged in for debugging then switch it back to the later for normal use.


4

For this you'll probably need a twofer. A schedule task in the OS firing off shutdown /h /t 2 at your scheduled time. One of the following: A BIOS timer to turn on your server. Leverage Wake-on-LAN and issue a Wakeup packet at the exact time you want that server powered back on.


4

For SQL Server (or in fact any Windows service) you can use the net stop <Service Name> and net start <Service Name> to stop/start the service. The service name you must use is not the display name, it's the actual name. To get that, go to the services control panel and view the service properties. It is the highlighted section on the ...


4

Cygwin's run.exe is intended for this job. See man run.


4

On Linux, this can be achieved with xargs: cat cmds | xargs -n 1 -P 6 -0 bash -c where cmds is a list of commands to execute using bash On Windows I suggest you try to solve this with PowerShell. There are multiple questions on this topic over at stack overflow


4

I'm guessing this script isn't signed. Have you enabled execution of unsigned scripts using the Set-ExecutionPolicy -ExecutionPolicy Unrestricted cmdlet?


4

This could be cleaned up a bit (i.e. mapping LastRunResult codes). Let me know if you need help. Triggers are a bit more difficult since I don't think the plain English representation you see when viewing a task in the GUI exists in the COM object. I believe it would have to be built from the TriggerCollection stored in RegisteredTask.Definition.Triggers ...


3

Go into Task Scheduler (taskschd.msc). While there, there's a button on the right menu for Display All Running Tasks. I think this is what you want. While you're there, you should turn on Enable All Tasks History, so you could track something like this better in the future.


3

First, let me tell you how you would run the script from a task: Program/script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Add arguments (optional): -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -command ". 'C:\Program Files\Microsoft\Exchange Server\bin\Exchange.ps1'; &'Z:\Exchange ...


3

Changing my answer since you changed the tag from Server 2008 to 2003... and I wasn't really accurate with my first answer. Whatever account is configured to run the scheduled task, a logon session is created for that account every time the task runs, a window station is created for that logon, and the windows are created in that window station/logon ...


3

There are a lot of monitoring solutions out there. SCOM, OpsView, Nagios, Cacti, Zabbix, etc. Look at them and pick one that suits your needs. If a ping script in a scheduled task meets your needs, then use that. On a side note: You really really shouldn't be running a production server inside of VMWare Workstation as your tags imply. It's a desktop ...


3

One way to accomplish this would be to use psexec like this: psexec /accepteula yourserver.yourdomain CommandToExecuteRemotely An alternative could be to enable PS Remoting on the remote server, then your scheduled task could be of the form powershell -command "Invoke-Command -ComputerName yourserver.yourdomain -FilePath ...


3

Even though the GUI drop down menu only goes down to 5 minutes... just try manually typing in 1 minute.


3

You may want to do a logon script. Startup scripts are run by the system when it boots up. Logon scripts are run in userland when the user logs on.


3

In a batch file: net stop service4 net stop service3 net stop service2 net start service2 net start service3 net start service4 Assuming you are using xp/2003 or above you could create a scheduled task to run the batch file. Assuming you want to repeat the task every 8 hours, pick a time for it to run, then on the properties of the scheduled task, ...


3

The only way to accomplish this is a bit of a workaround (in my opinion). You will need to create two actions for your task. The steps are as follows: Event is triggered The first action runs a query for the event details you're interested in and saves them to a file. The second action attaches the event details saved in Step 2 to an e-mail and sends it ...


3

Looks like your scheduled task user account doesn't have rights to write to \\igweb01\c$\sqlbackup and \\igsrv01\d$\sql backup.


3

One thing to note is where the script is running from. If you have a patch file that say references "test.log", running the batch directly from c:\logs will have no problems. But when task scheduler runs it it wont know where to find "test.log". So make sure that you either use full paths in your code, or you use the "Run in" function of task scheduler.


3

It sounds like you want to redirect the output of the command called from within the .bat file. Example.bat dir \ > Example_output.txt 2>&1 In this case, Example.bat runs a "dir" command on the "\" root directory, and the ">" sends the output of that dir to the file Example_output.txt. The 2>&1 modifies the redirection to include both ...


3

It's called crontab (click the name for a informative help page over at Ubuntu)


2

You've got a "1" in the word "create" the /tr argument has multiple double-quotes and doesn't contain the name of the 'program' to run. You don't need a "/sd" if you wan it to start today. If you run as system, it can't run the program from a network location (I'm wildly assuming that's what your trying to do with the double backslash in the "tr" argument, ...


2

First of all, I must chastise you for not writing this app as a native windows service. It is designed to run at startup, in the background, with no user interaction, forever (barring admin intervention). That's a textbook case of what a windows service does. Abusing the functionality of the Task Scheduler to start an app that runs forever is just ...



Only top voted, non community-wiki answers of a minimum length are eligible