How to run schtasks.exe from Visual Studio 2010 installer?

Viewed 711

I have a a Visual Studio 2010 solution with multiple C++ projects, and a windows installer project.

The installer works for the most part installing the deployment directories, and applications, and various shortcuts. the last thing I would like the installer to do is install a couple of Tasks in the Windows Task Scheduler.

I can run the schtask.exe from the command line and it works fine. I thought I could then just copy this same command to a CustomAction within the installer. However this does not work and the installation fails with the message "There is a problem with this windows installer package. A program required for this install could not be run..."

I have add the System Folder to the FileSystem setup, and in the CustomActions I have added a CustomAction under the Commit node.

The CustomAction sourcePath property is pointed to C:\Windows\System32\schtasks.exe and the Arguments property is "/create /tn ""WiwoCLLauncher"" /tr C:\ECS\WiwoCLLauncher.exe /sc ONSTART"

Can anyone give some insight on how to run schtasks.exe from the VS2010 installer?

1 Answers
Related