1.

Solve : Scheduling application launch with AT?

Answer»
I am using AT to schedule the start of an application, but the application is not visible to the current user.

Desired scenario: In a UTILITY application, the user will be able to choose a time to launch the application again on a regular basis--for example, every Tuesday at 11PM. The application will use DOS shell AT command to schedule the task. I want this to work at least on XP and Vista, and I'm having the PROBLEM on both. (The application will be distributed as freeware or shareware to a variety of users, so hopefully the users won't need to fiddle with any settings themselves.)

Simple test scenario:

I am using this shell command--
Code: [Select]at 11:00pm "C:\Path\test.bat"substituting an APPROPRIATE time and the path to the batch file

The batch file says--
Code: [Select]@echo off
start notepad
Result: The job is scheduled successfully (on Vista, this requires running the application as Admin) and runs successfully. However, the Notepad is invisible and only shows up if I go into the Task Manager and show all users--it's a System task. How can I make this execute visibly to the current user?

Thanks!Try adding the /interactive switch to the at command line:

Code: [Select]at 5:35am /interactive c:\path\test.bat

By scheduling a batch file, you also create an instance of the shell PROGRAM (%comspec%)

Why not schedule notepad directly?

Code: [Select]at 5:35am /interactive notepad.exe


Thanks, I had overlooked the /interactive switch! I think that's it.

However, when I tried it, I was informed (on Vista) that due to security, for interactive MODE I would have to use schtasks instead.

I used schtasks, and it worked.



Discussion

No Comment Found