---
title: Restart RSLinx in Service Mode Using a Scheduled Task
description: Fix intermittent RSLinx communication dropouts by automating a daily service restart with PowerShell and Task Scheduler.
---

[Skip to content](https://help.copia.io/knowledge/restart-rslinx-in-service-mode-using-a-scheduled-task#main-content)

English

Show submenu for translations

[More support](https://help.copia.io/knowledge/kb-tickets/new?hsLang=en)

![](https://help.copia.io/hubfs/Logo_Hotdog_BlackWhite%20(1).svg)

Open main navigation

Close main navigation

- English
  
  Show submenu for translations
- [More support](https://help.copia.io/knowledge/kb-tickets/new)
- Contact us

 Contact us

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Copia Help Center](https://help.copia.io/knowledge?hsLang=en)
2. [DeviceLink FAQ](https://help.copia.io/knowledge/devicelink-faq?hsLang=en)

# Restart RSLinx in Service Mode Using a Scheduled Task

## Automatically restart the RSLinx service each night to prevent communication dropouts in Rockwell environments

This procedure creates a Windows Scheduled Task that **silently restarts the Rockwell RSLinx service once per day** (default: 2:00 AM).   This can help resolve intermittent communication issues by ensuring RSLinx is refreshed on a regular basis.

#### **Prerequisites**

- Local administrator rights
- PowerShell available (*default on modern Windows*)

#### **Steps:**

**1)** Confirm the following directory exists, and if not, create it:  "***C:\\ProgramData\\Copia Automation***"

**2)** Open Notepad, paste the script provided below, and save it as “***C:\\ProgramData\\Copia Automation\\RSLinxServiceRestart.ps1***”

```
# RSLinx Management Script# ─────────────────────────────────────────# STEP 0: Self-elevate to Administrator when running in manual mode (Uncomment to run)# ─────────────────────────────────────────#if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {#    Start-Process PowerShell -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$($MyInvocation.MyCommand.Path)`"" -Verb RunAs#    exit#}# ─────────────────────────────────────────# Logging Setup# ─────────────────────────────────────────$ScriptFolder = Split-Path -Parent $MyInvocation.MyCommand.Path$LogFolder    = Join-Path $ScriptFolder "RSLinx Classic Service Restart Logs"$LogFile      = Join-Path $LogFolder "RSLinx_$(Get-Date -Format 'yyyy-MM-dd_HH-mm-ss').txt"if (-not (Test-Path $LogFolder)) { New-Item -ItemType Directory -Path $LogFolder -Force }# Keep only the last 7 logs (one per day = one week)Get-ChildItem -Path $LogFolder -Filter "RSLinx_*.txt" |    Sort-Object LastWriteTime -Descending |    Select-Object -Skip 7 |    Remove-Item -ForceStart-Transcript -Path $LogFile -AppendWrite-Host "=== RSLinx Management Script ==="Write-Host "Run Time: $(Get-Date)"Write-Host "Running as: $([Security.Principal.WindowsIdentity]::GetCurrent().Name)"# ─────────────────────────────────────────# STEP 1: Stop RSLinx application if running# ─────────────────────────────────────────Write-Host "`n[1] Checking for running RSLinx processes..."$processes = Get-Process | Where-Object {    $_.ProcessName -like "*rslinx*" -or $_.ProcessName -like "*rslinxclassic*"}if ($processes) {    Write-Host "    Found $($processes.Count) process(es). Stopping..."    $processes | Stop-Process -Force    Start-Sleep -Seconds 2    Write-Host "    RSLinx processes stopped."} else {    Write-Host "    No RSLinx processes found running."}# ─────────────────────────────────────────# STEP 2: Start RSLinx Service# ─────────────────────────────────────────Write-Host "`n[2] Starting RSLinx service..."try {    Start-Service -Name "RSLinx" -ErrorAction Stop    Write-Host "    RSLinx service started successfully."} catch {    Write-Host "    ERROR: Could not start RSLinx service."    Write-Host "    $_"}# ─────────────────────────────────────────# STEP 3: Set RSLinx Service to Automatic startup# ─────────────────────────────────────────Write-Host "`n[3] Configuring RSLinx service to start automatically..."try {    Set-Service -Name "RSLinx" -StartupType Automatic -ErrorAction Stop    Write-Host "    RSLinx startup type set to Automatic."} catch {    Write-Host "    ERROR: Could not configure startup type."    Write-Host "    $_"}# ─────────────────────────────────────────# SUMMARY# ─────────────────────────────────────────Write-Host "`n=== Done ==="$svc = Get-Service -Name "RSLinx" -ErrorAction SilentlyContinueif ($svc) {    Write-Host "    Service Status : $($svc.Status)"    Write-Host "    Startup Type   : $($svc.StartType)"}Stop-Transcript
```

**3)** Open Command Prompt as Administrator and run the command below.  The default run time is 02:00 *(2 AM)*.  To change it, modify /ST to your preferred time *(24-hour format)*

```
schtasks /Create /TN "RSLinx Daily Restart" /TR "powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -File \"C:\ProgramData\Copia Automation\RSLinxServiceRestart.ps1\"" /SC DAILY /ST 02:00 /RL HIGHEST /RU SYSTEM
```

 

#### **What This Does**

- Creates a scheduled task named **“RSLinx Daily Restart”**
- Runs **once per day**
- Executes your PowerShell script **silently (no visible window)**
- The task runs as System context by default
- Creates a log file for the last 7 days
- If needed, the task can be modified in **Task Scheduler** (taskschd.msc)

- [Getting Started](https://help.copia.io/knowledge/getting-started?hsLang=en#main-content)

    - [Sales Wiki](https://help.copia.io/knowledge/getting-started?hsLang=en#sales-wiki)
    - [Account Management](https://help.copia.io/knowledge/getting-started?hsLang=en#account-management)
    - [Customer Experience](https://help.copia.io/knowledge/getting-started?hsLang=en#customer-experience)
- [Source Control FAQ](https://help.copia.io/knowledge/source-control-faq?hsLang=en#main-content)

    - [Web App](https://help.copia.io/knowledge/source-control-faq?hsLang=en#web-app)
    - [Git Questions](https://help.copia.io/knowledge/source-control-faq?hsLang=en#git-questions)
    - [Desktop App](https://help.copia.io/knowledge/source-control-faq?hsLang=en#desktop-app)
    - [Tutorials](https://help.copia.io/knowledge/source-control-faq?hsLang=en#tutorials)
    - [Best Practices](https://help.copia.io/knowledge/source-control-faq?hsLang=en#best-practices)
    - [Source Control](https://help.copia.io/knowledge/source-control-faq?hsLang=en#source-control)
- [DeviceLink FAQ](https://help.copia.io/knowledge/devicelink-faq?hsLang=en#main-content)

    - [Siemens TIA Portal](https://help.copia.io/knowledge/devicelink-faq?hsLang=en#siemens-tia-portal)
    - [Agent](https://help.copia.io/knowledge/devicelink-faq?hsLang=en#agent)
    - [General](https://help.copia.io/knowledge/devicelink-faq?hsLang=en#general)
    - [Rockwell Studio 5000](https://help.copia.io/knowledge/devicelink-faq?hsLang=en#rockwell-studio-5000)

[![Chill listening crop-3](https://help.copia.io/hs-fs/hubfs/Logo_Hotdog_BlackTeal-1.png?width=87&height=24&name=Logo_Hotdog_BlackTeal-1.png "Chill listening crop-3")](http://copia.io)

43 W 24th St, 6th Floor  
New York, NY 10010

<https://www.facebook.com/> <https://www.twitter.com/> <https://www.instagram.com/> <https://podcasts.apple.com/> [mailto:email@email.com](mailto:email@email.com)

Copyright © 2025, Copia Automation, Inc.