Bytessence Installmaker add Scheduled Task

Just starting out? Need help? Post your questions and find answers here.
StanDan
User
User
Posts: 57
Joined: Sun Feb 26, 2006 3:43 am
Location: Missouri, United States

Bytessence Installmaker add Scheduled Task

Post by StanDan »

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. :D

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
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:

Code: Select all

%SYSTEMROOT%\system32\schtasks.exe /create /tn "Citation" /tr %1 /sc MINUTE /mo 1 /ru %2
It does exactly the same thing! No record of anything changing, no tasks created. :evil: 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". :(
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Bytessence Installmaker add Scheduled Task

Post by IdeasVacuum »

Hi StanDan - this post is in the wrong thread really, try putting it in the actual Bytessence one:
http://www.purebasic.fr/english/viewtop ... &start=165
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply