B
BrooklynParkMikey
I have tried several different techniques to start a ClickOnce application using Windows 10 Task Scheduler. None of them are satisfactory. For some of the attempts, the program doesn't seem to start (There is no indication in Event Log or Task Schedule History that there was an error and the output file is not created). For other attempts, the program starts, creates the output file and then never terminates.
Windows 10 Version 1909 (OS Build 18363.657)
Here are the attempts that I made to discover a solution:
__________________________________________________________________________________________________
Doesn't work at all. Task Scheduler says it is running but it is not running. Program does not execute.
Program:
cmd.exe
CommandLine:
/c "C:\Users\MyUserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Publisher Name\Suite Name\MyAppName.ms-appref"
__________________________________________________________________________________________________
Doesn't work at all. Task Scheduler says it is running but it is not running. Program does not execute.
Program:
cmd.exe
Arguments:
/c C:\Users\MyUserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Publisher Name\Suite Name\MyAppName.ms-appref
__________________________________________________________________________________________________
Program runs and creates output file. In Task Manager, can see that it ran the correct version of the EXE. The EXE never terminates.
Program:
rundll32.exe
Arguments:
dfshim.dll,ShOpenVerbApplication https://mywebsite.com/ClickOnceDir/MyAppName/MyAppName.application
__________________________________________________________________________________________________
Program runs and creates output file. In Task Manager, can see that it ran the correct version of the EXE. The EXE never terminates.
Program:
c:\bat\xxx.bat
Arguments:
<No Arguments>
Contents of xxx.bat file:
REM Run the ClickOnce service (DFSVC.EXE) if is is not already running
tasklist /NH /FI "IMAGENAME eq dfsvc.exe" 2>NUL | find /I "dfsvc.exe">NUL
if errorlevel 1 start "" "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\dfsvc.exe"
REM Run the MyAppName ClickOnce application - Calendar icon should show for a moment in the task bar
"%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\My Publisher Name\My App Directory\MyAppName.appref-ms"
__________________________________________________________________________________________________
The EXE never terminates. The program shows in Task Manager but doesn't create the output file. In Task Manager, it shows that C:\Windows\System32\OpenWith.exe was run with the parameter: ""C:\Users\MyUserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Publisher Name\Suite Name\MyAppName.ms-appref""
Program:
"C:\Users\MyUserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Publisher Name\Suite Name\MyAppName.ms-appref"
Arguments:
<No Arguments>
Continue reading...
Windows 10 Version 1909 (OS Build 18363.657)
Here are the attempts that I made to discover a solution:
__________________________________________________________________________________________________
Doesn't work at all. Task Scheduler says it is running but it is not running. Program does not execute.
Program:
cmd.exe
CommandLine:
/c "C:\Users\MyUserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Publisher Name\Suite Name\MyAppName.ms-appref"
__________________________________________________________________________________________________
Doesn't work at all. Task Scheduler says it is running but it is not running. Program does not execute.
Program:
cmd.exe
Arguments:
/c C:\Users\MyUserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Publisher Name\Suite Name\MyAppName.ms-appref
__________________________________________________________________________________________________
Program runs and creates output file. In Task Manager, can see that it ran the correct version of the EXE. The EXE never terminates.
Program:
rundll32.exe
Arguments:
dfshim.dll,ShOpenVerbApplication https://mywebsite.com/ClickOnceDir/MyAppName/MyAppName.application
__________________________________________________________________________________________________
Program runs and creates output file. In Task Manager, can see that it ran the correct version of the EXE. The EXE never terminates.
Program:
c:\bat\xxx.bat
Arguments:
<No Arguments>
Contents of xxx.bat file:
REM Run the ClickOnce service (DFSVC.EXE) if is is not already running
tasklist /NH /FI "IMAGENAME eq dfsvc.exe" 2>NUL | find /I "dfsvc.exe">NUL
if errorlevel 1 start "" "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\dfsvc.exe"
REM Run the MyAppName ClickOnce application - Calendar icon should show for a moment in the task bar
"%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\My Publisher Name\My App Directory\MyAppName.appref-ms"
__________________________________________________________________________________________________
The EXE never terminates. The program shows in Task Manager but doesn't create the output file. In Task Manager, it shows that C:\Windows\System32\OpenWith.exe was run with the parameter: ""C:\Users\MyUserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Publisher Name\Suite Name\MyAppName.ms-appref""
Program:
"C:\Users\MyUserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Publisher Name\Suite Name\MyAppName.ms-appref"
Arguments:
<No Arguments>
Continue reading...