Arama Yap Mesaj Submit
Request a Callback
+90
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro

Contact Us

Location Halkali merkez neighborhood fatih st ozgur apt no 46 , Kucukcekmece , Istanbul , 34303 , TR

Windows Task Scheduler and Server Automation

Meet 2026's modern server management standards. Automate repetitive tasks on your Windows VDS and physical servers, create PHP cron jobs, and effortlessly manage system maintenance with PowerShell. Discover the power of automation with Eka Sunucu's high-performance infrastructure.

What is Windows Task Scheduler?

Windows Task Scheduler is a powerful management tool that allows programs or scripts to run automatically in Windows operating systems at predefined times or when certain events occur (a computer turning on, a user logging in, etc.). on Linux systems Cron Job It is the Windows equivalent of the structure and modern Windows VDS is the backbone of management.

Periodic Missions

Automate routine tasks such as daily, weekly or monthly reporting, database cleanup and system updates.

Running PHP Script

Run your website's background processes (email sending, order checking) on the server side without the need for a browser.

Automatic Backup

Regularly back up your critical files and SQL databases and move them to secure areas without human error.

Performance Management

Create scripts that monitor server resources and automatically intervene in certain situations (high CPU, low disk).

Step 1: Accessing Task Scheduler

Accessing Task Scheduler on Windows Server 2019, 2022 or 2025 is quite simple. Correct configuration is critical to the security and performance of your server.

  • Run: Win + R Press the keys.
  • Komut: taskschd.msc Type it and press Enter.
  • Alternative: You can also access it under the Server Manager > Tools menu.
2026 Hint: In modern Windows Server versions, always creating tasks with the "Create Task" option instead of "Create Basic Task" allows you to set critical security settings such as "Run with highest privileges".
CMD/PowerShell Access
# Görev Zamanlayıcıyı komut lineından hızlıca açmak for:
Start-Process "taskschd.msc"

# Veya mevcut görevleri listelemek for PowerShell kullanabilirsiniz:
Get-ScheduledTask | Where-Object { $_.State -eq 'Running' }

Creating a PHP Cron Job on Windows

One of the features most frequently needed by web developers is the automatic execution of certain PHP files (e.g. invoice creation, mail queue processing). To do this on Windows php.exeWe use .

Sample PHP Script (cron.php)

First, let's have a simple PHP file that will run automatically. This file will record in a log file.

C:\inetpub\wwwroot\automation\cron.php
<?php
// Zaman dilimi ayarı
date_default_timezone_set('Europe/Istanbul');

// Log dosyasının yolu
$logFile = __DIR__ . '/gorev_loglari.txt';
$time = date('Y-m-d H:i:s');

// Structurelacak işlem (Örn: Veritabanı temizliği, mail gönderimi)
// Simülasyon:
$message = "[{$time}] Otomatik gorev basariyla calisti." . PHP_EOL;

// Log dosyasına yaz
file_put_contents($logFile, $message, FILE_APPEND);

echo "Worklem tamamlandı.";
?>

Creating a Batch (.bat) File

Instead of calling PHP directly, a .bat Creating a file and introducing it to Task Scheduler is easier to manage and simplifies debugging.

C:\inetpub\wwwroot\automation\run_cron.bat
:: Eka Sunucu Otomasyon Scripti
@echo off

:: PHP.exe'nin tam yolu (Sunucunuzdaki yola göre değiştirin)
set PHP_BIN="C:\Program Files\PHP\v8.3\php.exe"

:: Çalıştırılacak PHP dosyasının yolu
set SCRIPT="C:\inetpub\wwwroot\otomasyon\cron.php"

:: Scripti çalıştır
%PHP_BIN% -f %SCRIPT%

:: İsteğe bağlı: Pencereyi kapat
exit
Task Scheduler Settings
  1. Create Task Click .
  2. General tab: Give a name and "Run whether user is logged on or not" Check the option.
  3. Triggers in the tab: New Set the frequency (Daily, Weekly, or "Repeat task every 5 minutes" by saying).
  4. actions in the tab: New say, Action: "Start a program". You created in the program/script section run_cron.bat Show the full path to the file.
  5. Start in (Optional) to the part .bat Type the folder path where the file is located (Ex: C:\inetpub\wwwroot\otomasyon\). This is critical to avoid corrupting file paths (include/require).

File Backup Automation with PowerShell

The most powerful tool on Windows servers is PowerShell. The script below compresses (ZIP) your website files and moves them to the backup folder, date-stamped. It also automatically deletes backups older than 7 days.

C:\Scripts\Backup-Web.ps1
# --- Eka Sunucu Automatic Backup. Scripti ---

# Ayarlar
$Source = "C:\inetpub\wwwroot\projem"  # Yedeklenecek Klasör
$Destination = "D:\Yedekler"           # Yedeğin Atılacağı Yer
$Date = Get-Date -Format "yyyy-MM-dd_HH-mm"
$ZipPath = "$Destination\Yedek_$Date.zip"

# Klasör yoksa create
if (!(Test-Path -Path $Destination)) {
    New-Item -ItemType Directory -Path $Destination
}

# Dosyaları Sıkıştır
Compress-Archive -Path $Source -DestinationPath $ZipPath -Force

Write-Host "Yedekleme Tamamlandı: $ZipPath"

# 7 Günden eski dosyaları temizle (Disk doluluğunu önlemek for)
$DaysLimit = 7
Get-ChildItem -Path $Destination -Filter "*.zip" |
Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-$DaysLimit) } |
Remove-Item

Write-Host "Eski yedekler temizlendi."

To Add This Script to Task Scheduler:

As Program/script in Action section: powershell.exe

In the Add arguments section: -ExecutionPolicy Bypass -File "C:\Scripts\Backup-Web.ps1"

Windows VDS Packages

High-performance Windows servers with NVMe SSD disks for your automation processes.

Windows Start

499 ₺ / Ay
  • 2 vCPU Core
  • 4 GB RAM
  • 50 GB NVMe SSD
  • Win 2019/2022
  • 1 Gbit Port

Windows Ultra

1999 ₺ / Ay
  • 8 vCPU Core
  • 16 GB RAM
  • 250 GB NVMe SSD
  • Win 2019/2022/2025
  • 1 Gbit Port

Frequently Asked Questions (2026 Current)

I am getting Task Scheduler 0x1 error, what is the solution?

Error code 0x1 is usually a "authorization" or "path" error. Check the following: 1) Is "Run with highest privileges" selected in the task properties? 2) Is the "Start in" folder path defined as the folder where the script is located? 3) Is the user account you are using authorized to run the script?

What to use instead of Cron Job in Windows?

In Windows operating systems, the term "Task Scheduler" is used instead of "Cron Job". Everything you do with crontab commands in Linux, you can do with Task Scheduler's visual interface or PowerShell commands.

Will my scripts run when the server is restarted?

Yes, if you select "At Startup" as the Trigger when creating the task, your task will run automatically every time the server restarts. It may be a good practice to add a delay for web server services (IIS, Apache, Nginx) to start.

Is there management support in Eka Sunucu Windows VDS packages?

All physical and in our virtual server packages, initial installation and optimization support is free. You can contact our professional support team for advanced automation setups and special script software.

Leave Server Management to Professionals

Combine the power of automation with the high-performance Eka Sunucu infrastructure.

Hosting Solutions Contact Us

Advanced Topics on Windows Task Scheduler

Use of Managed Service Accounts (gMSA), automation in the context of security, Event Viewer log tracking and PowerShell 7.4+ integration.

Top