Task scheduler on windows XP - windows-xp

I have some task/ program to run on an windows XP machine at some specific dates. The dates are stored inside a .dbf and the dates will be dynamic. How can I schedule the tasks on the specific dates?
I am planning to write another program (perhaps c# service) to run cmd with the command at to create tasks in task scheduler. Is there any ways to specify all the dates into one task? And will it be possible to link the task scheduler with a DB? Thanks!

I wrote a C# wrapper, that is script callable, that will work with the Task Scheduler on both XP and Windows 7. The download and source code is at https://taskscheduler.codeplex.com. With that wrapper, you can create a task that executes an action that has multiple triggers. Those triggers can be set for single days, weeks, months, etc. with different repetition patterns. There are many samples both in the documentation and discussion areas to help with your coding.

Related

Running Windows Powershell script always from task scheduler

This might be a very basic question. I have FileWatcher script in windows powershell which I want to run always so that it keeps watching a particular location for files. when I run it from Windows Powershell IDE its run perfectly fine. I understand that I can schedule a task in windows task scheduler for that but what's happening is that the task runs and then comes back in "Ready" status. This is NOT working. I think it should be in "Running" state always. I might be missing something. Please kindly help with your valuable suggestions.
You can do this with TaskSchedule…
Running PowerShell scripts as a “service” (Events: Prologue)
but this is also what permanent Event Subscriptions are for or setting up as user10675448 suggest, make it a real service.
How to run a PowerShell script as a Windows service
Windows PowerShell - Writing Windows Services in PowerShell
This article presents the end result of that effort: A novel and easy
way to create Windows Services, by writing them in the Windows
PowerShell scripting language. No more compilation, just a quick
edit/test cycle that can be done on any system, not just the
developer’s own.
There is also this approach...
PowerShell and Events: Permanent WMI Event Subscriptions
Unlike the temporary event, the permanent event is persistent object
that will last through a reboot and continue to operate until it has
been removed from the WMI repository.
There are multiple ways of setting up the WMI events and I will be
covering 3 of those ways (as they deal with PowerShell) in this
article.

Using SQL developer to automate several sql scripts

I have several scripts that I run in SQL Developer every day. I have it set up as #script_1.sql; #script_2.sql; #script_n.sql; and I hit F5 and let it run through all my scripts and then look at my results when it has finished parsing through all of them. I want to have this automated so it is finished running those scripts by the time I get into work. My system admins have disabled task scheduler. I have a few jobs set up that work fine but when I tried turning this into a job it wouldn't work. How would I automate this using only SQL Developer?
You could create a package and convert those SQL files into its procedures. Then schedule their execution with DBMS_JOB or DBMS_SCHEDULER package.

Run Powershell script every hour on Azure

I have found this great script which backs up SQL Azure database to BLOB.
I want to run many different variations of this script - e.g. DB1 goes to Customer1Blob, DB2 goes to Customer2Blob.
I have looked at Scheduler Job Collections. However I can only see options (Action settings) for HTTP(S)/ Storage Queue / Service Bus.
Is it possible to run a specific .ps1 script (with commands) scheduled?
You can definitely run a Powershell script as a WebJob. If you want to run a script on a schedule, you can add a settings.job file containing a chron expression with your webjob. The docs for doing so are here.
For this type of automation tasks, I prefer to use the Azure Automation service. You can create runbooks using powershell and then schedule this with the use of the Azure scheduler. You can have it run "on azure" so you do not need to use compute power that you pay for (rather you pay by the minute the job runs) or you can configure it to run with a hybrid worker.
For more information, please see the documentation
When exporting from SQL DB or from SQL Server, make sure you are exporting from a quiescent database. Exporting from a database with active transactions can result in data integrity issues - data being added to various tables while they are also being exported.

How to create JOB in AS400?

I'm new to AS400 DB2 , I have 3 procedures in AS400, now those procedure should be execute by calling single job in AS400.
Can you tell me please how to create a job and execute job in AS400 DB2 Mainframe ?
You're probably not using an AS/400 running OS/400; they have been obsolete for 10 years. You're probably using a POWER server running IBM i.
POWER servers are not mainframes, they are mid-range systems.
On the IBM i, a job is how the operating system organizes, tracks, and processes work. On other platforms, you'd call it a process.
Jobs are the basis of work management
When you sign onto a 5250 session, the system starts an "interactive job" to service your requests. You can't call procedures directly, but you can call a program that then calls the procedures.
There are plenty of common jobs tasks. Including the use of Submit Job (SBMJOB) command to submit a job to run in batch.
From what I understand, you want to run 3 programs in by invoking a single command. Is that it?
In OS/400 (haven't used it in over a decade) you put the commands for the programs into a CL source and compile it. Unlike .bat files on Windows, CL isn't going to run without compilation.
Refer to https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rbam6/creat.htm for how to create a CL program.

PowerShellPack - TaskScheduler module - run task with no logged user

I need to schedule a task via Powershell v2 on Windows Server 2008. I am using the TaskScheduler module from the MS PowershellPack.
Scheduling a task is ok, but I need the task to run even nobody is logged on.
I saw that this is possible in Powershell v3 on Win8 or Win2k12 (this QA). But that is not my case - I need to this in Powershell version 2.
Is this possible with module I am using? Or is there some workaround?
http://msdn.microsoft.com/en-us/library/windows/desktop/bb736357(v=vs.85).aspx
Not possible down in the V2 world, But this will accomplish everything you need, and can be directly called from powershell
Edit:
This question got me thinking, and I realized your scenario is slightly different than mine, making it so this Should Be Possible.. So I was wrong before. Turns out, the Scheduler.service comobject is compatible with Powershell 2.0, but also only works with Task Scheduler 2.0. I thought it wasn't because I am on xp, and Task Scheduler 2.0 is only available in vista and up.
Looking into the source code of that MS PowershellPack, I found that all it is doing is using the Scheduler.service com object. https://github.com/sushihangover/SushiHangover-PowerShell/tree/master/modules/TaskScheduler
For a good tutorial of how to manipulate this com object for yourself : https://blogs.technet.microsoft.com/heyscriptingguy/2009/04/01/hey-scripting-guy-how-can-i-best-work-with-task-scheduler/
And the answer to your question: How to set schedule.service "Run whether user is logged on or not" in Powershell?
Sorry for the misunderstanding.. I won't let it happen again :D
Either way the schtasks.exe will cover all your bases and IMO is easier to work with, because it is one command, and doesnt require you to Invoke-Session when trying to schedule a task on a remote server.