From 6150663a994d0c5af10551bd628f26949e7ade8c Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 15 Oct 2020 01:43:51 +0800 Subject: [PATCH] Change ddns.exe to cmd in Windows Task Scheduler. Windows Task Scheduler is not CMD, the redirecting operator '>>' can only effect in CMD. So the operator will cause '0x2' error in Windows Task Scheduler. My last commit https://github.com/NewFuture/DDNS/pull/208/commits/8ea0d5976de4a668e973e19548c8f2315f7b930f will force add the redirecting to the Win TS due to the double quotes in ```RUNCMD```, while the previous commit did not add redirecting to Win TS as expected and the log file was always empty. One solution in this commit is to change the running program in Win TS from ddns.exe to cmd, then run ddns.exe in cmd. So that the Task can run as scheduled and the log can also be redirected. --- .release/create-task.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.release/create-task.bat b/.release/create-task.bat index b0380c3..6344b8e 100644 --- a/.release/create-task.bat +++ b/.release/create-task.bat @@ -1,7 +1,7 @@ @ECHO OFF REM https://msdn.microsoft.com/zh-cn/library/windows/desktop/bb736357(v=vs.85).aspx -SET RUNCMD="'%~dp0ddns.exe' -c '%~dp0config.json' >> '%~dp0run.log'" +SET RUNCMD="cmd /c ''%~dp0ddns.exe' -c '%~dp0config.json' >> '%~dp0run.log''" SET RUN_USER=%USERNAME% WHOAMI /GROUPS | FIND "12288" > NUL && SET RUN_USER="SYSTEM"