witterholt
08-13-2014, 02:23 PM
Hello,
From within my custom action of my Basic MSI project I try to import a scheduled task from a XML file by using the "schtasks.exe" command.
When I try to do this with a custom action of type "EXE" I constantly get a 1721 or a 1722 error.
When I try to do this with a custom action of type "VBSCRIPT" no errors occur, but the scheduled task is not created.
When I use the command in a command shell that is run as Administrator also: the scheduled task is created.
The properties that I use, DOMAIN, USERNAME, PASSWORD and INSTALLDIR, are filled correctly with their values.
I am installing on a Windows Server 2008 R2 64 bit machine.
The command that I execute has this form:
schtasks.exe /Create /TN "<Task name>" /RU [DOMAIN]\[USERNAME] /RP [PASSWORD] /XML "[I]<XML File Name>"
The reason why I don't use the InstallShield functionality to create a scheduled task is that it has no options to repeat a task for a certain amount of minutes. Furthermore I need to define multiple actions in one scheduled task.
I think it has something to do with too few privileges to create the task from within InstallShield, despite the setup is executed as Administrator.
Any help is greatly appreciated!
Regards,
Chris.
From within my custom action of my Basic MSI project I try to import a scheduled task from a XML file by using the "schtasks.exe" command.
When I try to do this with a custom action of type "EXE" I constantly get a 1721 or a 1722 error.
When I try to do this with a custom action of type "VBSCRIPT" no errors occur, but the scheduled task is not created.
When I use the command in a command shell that is run as Administrator also: the scheduled task is created.
The properties that I use, DOMAIN, USERNAME, PASSWORD and INSTALLDIR, are filled correctly with their values.
I am installing on a Windows Server 2008 R2 64 bit machine.
The command that I execute has this form:
schtasks.exe /Create /TN "<Task name>" /RU [DOMAIN]\[USERNAME] /RP [PASSWORD] /XML "[I]<XML File Name>"
The reason why I don't use the InstallShield functionality to create a scheduled task is that it has no options to repeat a task for a certain amount of minutes. Furthermore I need to define multiple actions in one scheduled task.
I think it has something to do with too few privileges to create the task from within InstallShield, despite the setup is executed as Administrator.
Any help is greatly appreciated!
Regards,
Chris.