XL2     &                Hx`     TypeV2Obj ID                DDirBftDBօSImEcAlgoEcMEcN EcBSize   EcIndexEcDistCSumAlgoPartNumsPartETags 8bd19d9a3ff38f90e456c18f21b12d5cPartSizestPartASizestPartIdx SizetMTimeHx`̧MetaSysx-rustfs-internal-inline-datatruex-minio-internal-inline-datatrueMetaUsretag 8bd19d9a3ff38f90e456c18f21b12d5ccontent-typetext/markdownv Μnull~F6?Od~&U(jD@?# Capsicain_RDP_Toggle

This folder contains the script and log used by the Windows Scheduled Task named `Capsicain_RDP_Toggle`.

The task runs `ToggleCapsicainWhenRDPSessionCreatedByPad.ps1` when the user logs on and when the RDP session state changes. The script checks the current Windows Terminal Services sessions directly instead of relying on the delayed `CLIENTNAME` environment variable.

Behavior:

- If an active RDP session from a client matching `*iPad*` is detected, the script stops `capsicain.exe`.
- If no matching iPad RDP session is active, the script starts Capsicain through `conhost.exe --headless`.
- The script is idempotent, so repeated task triggers only record that the process is already stopped or already running.

Files:

- `ToggleCapsicainWhenRDPSessionCreatedByPad.ps1`: Main toggle script.
- `toggle_log.txt`: Runtime log showing detected WTS sessions, active remote client names, and the action taken.

The scheduled task action should point to:

```text
powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File "D:\_scripts\Capsicain_RDP_Toggle\ToggleCapsicainWhenRDPSessionCreatedByPad.ps1"
```
