Bytessence Installmaker add Scheduled Task
Posted: Sun Apr 01, 2012 12:44 am
Aaahg! I've been pulling my hair out for the past two days over this. I feel a bit like I'm Frodo carrying the One Ring to Mount Doom, only I happen to be on that one bad day where they were lost in the Dead Marshes. And I'm naked. Or... something... It's pretty bad. 
I've finally solved my issue of running my program only when the system is idle, by adding a scheduled task. This works GREAT during testing. Unfortunately, I can't figure out how to create a scheduled task from the Byteessence Installer. At the moment I'm using a Run Program (execute after unpacking the files) statement and I run an included .bat file called add_task.bat. I run it with "<ProgramDir>\main.exe" as the first argument. The add_task.bat file contains:
If I run it from cmd.exe it works great. It doesn't seem to do anything when run from the installer. I'm sure this is because the installer is limited somehow, but I can't figure out what is needed. If I try to change the add_task.bat arguments to "<ProgramDir>\main.exe" "<CurrentUserName>"
Then change the add_task.bat to:
It does exactly the same thing! No record of anything changing, no tasks created.
Wtf, this stuff is the DEEP MAGIC. Why can't this be as simple as crontab?? lol
I've searched on Google and on the forum and can't find any help. It looks like someone has spammed Google with "Byteessence Installer".

I've finally solved my issue of running my program only when the system is idle, by adding a scheduled task. This works GREAT during testing. Unfortunately, I can't figure out how to create a scheduled task from the Byteessence Installer. At the moment I'm using a Run Program (execute after unpacking the files) statement and I run an included .bat file called add_task.bat. I run it with "<ProgramDir>\main.exe" as the first argument. The add_task.bat file contains:
Code: Select all
%SYSTEMROOT%\system32\schtasks.exe /create /tn "Citation" /tr %1 /sc MINUTE /mo 1
Then change the add_task.bat to:
Code: Select all
%SYSTEMROOT%\system32\schtasks.exe /create /tn "Citation" /tr %1 /sc MINUTE /mo 1 /ru %2

I've searched on Google and on the forum and can't find any help. It looks like someone has spammed Google with "Byteessence Installer".
