1.

Solve : How can I install a scheduled task??

Answer»

Greetings

I have a particularly difficult problem that needs a skilled programmer's attention. After a series of failed attempts, I decided to turn to you guys.

The point is this:

1. I'm a fairly computer-literate person with a keen interest in graphic design. Additionally I serve as my whole family's computer technician, which bothers me immensely. To remedy this I decided to create a sort of "reminder/maintenance" program to encourage them to do things for themselves and perform routine maintenance without my help.

2. Since I know absolutely nothing about real programming, I have created a standalone projector in Flash that enables the user to install freeware such as Spybot, Ad-aware, a backup program, an antivirus etc.

3. I have created another standalone projector that enables the user to click a series of links to perform maintenance tasks such as backup and cleaning. Each link points to a file that starts the desired program, such as Ad-aware. This standalone projector (and additional files) is copied via a batch file to C:\Program Files\Maintenance from the install CD.

4. Now the only thing I need is an executable\batch file that schedules this standalone projector to open once every month. I've tried a few things but I cannot create a scheduled task via a batch file, and more annoyingly, hide (or exit) the *censored* CMD window after the projector has been started. Each time I use the START command the CMD window won't hide. And for some reason the switches won't work properly, just generate errors, such as "Not a recognized switch command". (Hehe, listen to me rambling on using terminology I have barely any concept of). However, I'm sure that 20 webpages on swiches can't all be wrong, so it must be something I'm doing wrong.


Any ideas on how I can get this thing to work? The path to the file that I want started should be

"C:\Program Files\Maintenance\Maintenance.exe" .


I have READ other postings which I found insightful, but not helpful as such. I'm using Windows XP Professional SP2.

Any help WOULD be greatly appreciated.

Best regards

MrFrost from IcelandYou can use the AT command:

Code: [Select]
AT 8:00PM /every:15  "C:\Program Files\Maintenance\Maintenance.exe"

will schedule a job to run at 8:00PM on the fifteenth of every month. Primitive, but it gets the job DONE. Change the parameters to your situation.

XP Pro (not HOME) users can also use the SCHTASKS command.

All Windows users can use the task scheduler found in system tools. This uses a GUI that makes this chore an idiots delight (I use this method all the time )

Windows users can also write a WinScript, but this is problematical as there are two API's for scheduled jobs and neither can see what the other has done!

One question: How are you going to schedule the job that puts the job on the schedule?  Hi there, and thanks for the reply.

I have considered the at command and tried to implement it with my limited knowledge, using echo and such commands but with limited results. The task scheduler is of course a good solution, but for some of my family, even that is too
"technical". Also, I was considering PUTTING the package on the net and offering it for free download.

Thus, it would need a idiot-proof interface. I have already constructed a free rescue disk that needs very little basic forehand knowledge to use. The applications are launched via the fscommand and a small tool from Flashgeek (http://www.flashgeek.com/tutorials/flashgeek.ZIP). The applications include a free tutorial on basic data rescue, a HDD repair tool, INSERT Linux Repair disk image  (www.insert.de), etc. Of course you need to have access to another computer to view the disk but that is a minor problem, since most people have access to a netcafe or a friends PC.

My plan is this:

1. Create an install disk to install the applications on the HDD. Then the user clicks a link that activates a bat file that copies the Maintenance.exe package to the HDD The package is ready to run as is. Then the same file activates a file that can install the scheduled task. Then the bat file exits.

2. The Maintenance package is activated once every month to remind people to backup their files and run maintanance programs. Since I know the location of each .exe file that I want activated, it is no problem to insert that path into the Flashgeek tool and have that little program run Ad-aware, Spybot, Backup etc. The Flashgeek tool is activated via a FSCommand in the Flash Projector.


As I said before, now the only thing I need is the file that can install the scheduled task on the user's computer. But I have no idea on how to write the code. All efforts I have made using the bat file code have failed.

Any ideas?

Best regards
MrFrostMr Frost,

I seem to be missing something here. Can you not simply include the appropriate AT command in the batch file that installs maintenance.exe?

Scheduling a job for execution is a one shot deal. Once scheduled, a job will run at the scheduled time and the schedule will be updated to reflect the next time to be run (ad infinitum).

Hope this helps. Hi again... the problem is twofold...

Firstly, I was not sure that using the AT command would be possible in a bat file since I tried prograsmming it but it alwys turned out wrong. Now that you've answered that question, it brings be to the second one.

Secondly, what should the code look like? After all my trying, I'm fairly convinced that I don't have a clue what I'm doing. Any pointers?

Also... I have access to a bat2exe program... do you recommend converting the file to exe? Or perhaps it doesn't make any difference?

Best regards
MrFrostBasically a installation file is just a REVERSE of what you did to create the install disk.

Code: [Select]
md C:\Program Files\Maintenance
copy Maintenance.exe C:\Program Files\Maintenance
copy flash1.exe C:\Program Files\Maintenance
copy flash2.exe C:\Program Files\Maintenance
AT 8:00PM /every:15  "C:\Program Files\Maintenance\Maintenance.exe"


Obviously this is very crude. If the flash files go into a different directory than the maint program you would need to create the directory ahead of the copies.

Using a directory list of the install disk will give you the files locations for the first paramter of the copy (best not to hardcode a drive). The second parameter of each copy would be where you want the files after the install.

If the disk you're referring to is a cd, you can also create an autorun.inf file on the disk which will kick everything off and all your users would need to do is insert the disk.

autorun.inf:
Code: [Select]
[autorun]
open=yourinstallprogram.bat


Many ways to do this from simple to complex. Best thing is to have your batch file do everything you would have to do if you were installing it manually (file by file).

Hope this gives you some ideas. YESSSSSSS!!!!

It works perfectly. I couldn't believe that it was this simple, I was sure that there had to be some command before the whole AT command string. I'm such an idiot, I should have tried it all along.

Sindewinder, you're the best!  I've added you into the credits  on the maintenance interface. PM me with your email for screenshots :)



Discussion

No Comment Found