Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 如何在计划任务中使用System.Configuration.Install.Installer?_.net_Windows Installer_Scheduled Tasks - Fatal编程技术网

.net 如何在计划任务中使用System.Configuration.Install.Installer?

.net 如何在计划任务中使用System.Configuration.Install.Installer?,.net,windows-installer,scheduled-tasks,.net,Windows Installer,Scheduled Tasks,System.Configuration.Install.Installer的子类与InstallUtil.exe结合使用非常有用,因为它具有事务性行为和易于卸载 我的特定应用需要在安装时创建计划任务(Windows任务计划程序),并在卸载时删除此计划任务。我看到服务中有一个ServiceInstaller,但是对于计划的任务是否有等价的东西?或者,作为(un)安装的一部分创建/删除任务的建议方法是什么?您可以编写一个脚本文件来调用 安装任务 schtasks /Create ... scht

System.Configuration.Install.Installer
的子类与
InstallUtil.exe
结合使用非常有用,因为它具有事务性行为和易于卸载


我的特定应用需要在安装时创建计划任务(Windows任务计划程序),并在卸载时删除此计划任务。我看到服务中有一个
ServiceInstaller
,但是对于计划的任务是否有等价的东西?或者,作为(un)安装的一部分创建/删除任务的建议方法是什么?

您可以编写一个脚本文件来调用

安装任务

schtasks /Create ...
schtasks /Delete ...
卸载任务

schtasks /Create ...
schtasks /Delete ...