Skip to content

Commit b5ded6f

Browse files
committed
fix: Fix scheduling task was not working on Windows of non-English locale. (Fix #4)
1 parent 7348055 commit b5ded6f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

distrod/distrod/resources/schedule_autostart_task.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
While ($true) {
22
Start-Process C:\Windows\System32\schtasks.exe "/create /ru {{USER_NAME}} /tn {{TASK_NAME}} /xml {{TASK_FILE_WINDOWS_PATH}}" -Verb runas -Wait
3-
If ([bool](schtasks /query /fo list | Select-String -pattern "TaskName:\s+\\{{TASK_NAME}}" -quiet)) {
3+
If ([bool](schtasks /query /fo list | Select-String -pattern "\s\\{{TASK_NAME}}" -quiet)) {
44
echo "Enabling autostart has succeeded."
55
break
66
}

distrod/distrod/resources/unschedule_autostart_task.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
If ([bool](schtasks /query /fo list | Select-String -pattern "TaskName:\s+\\{{TASK_NAME}}" -quiet)) {
1+
If ([bool](schtasks /query /fo list | Select-String -pattern "\s\\{{TASK_NAME}}" -quiet)) {
22
Start-Process C:\Windows\System32\schtasks.exe "/delete /tn {{TASK_NAME}} /f" -Verb runas -Wait
33
echo "Autostart has been unscheduled."
44
break

0 commit comments

Comments
 (0)