Scheduling a task with the AT command

Is it possible to use the a AT command to schedule a task that will run daily and be visible to any user that is logged in?  The task also has to run if there is no user logged in.  
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

run it under the system account...if you're using xp, you can use schtasks.

Example, to run internet explorer every day at noon:

schtasks /create /ru system /sc daily /st 12:00:00 /tn IE /tr "iexplore.exe"
Of course, IE wouldn't be visible by other users in that context - what sort of task are you looking at exposing to all users?
bosn1Author Commented:
I have to shutdown our desktops at night.  I have to provide the users with a 30 minute warning and an option to cancel.  I have everything built but cannot figure out how to schedule it to run under any user condition.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Have messenger enabled?

You could do something like

net send %computername% Computer shutting down in 30 minutes...

scheduled for 7:30, for example
and then have the shutdown command launch at 7:59 with a 60 second timer...I think shutdown is limited to 60 seconds max...

If you need it all in one batch file:
@echo off
net send %computername% Computer shutdown in 30 minutes.
ping -n 1740
shutdown -s -t 60

Open in new window

If you're workstations are Windows XP perhaps tsshutdn will be your answer.

tsshutdn /?
Shut down a server in a controlled manner.

TSSHUTDN [wait_time] [/SERVER:servername] [/REBOOT] [/POWERDOWN]
         [/DELAY:logoffdelay] [/V]

  wait_time           Seconds to wait after user notification before
                      terminating all user sessions (default is 60).
  /SERVER:servername  The server to shut down (default is current).
  /REBOOT             Reboot the server after user sessions are terminated.
  /POWERDOWN          The server will prepare for powering off.
  /DELAY:logoffdelay  Seconds to wait after logging off all connected
                      sessions (default is 30).
  /V                  Display information about actions being performed.

at \\REMOTECOMPUTERNAME 1:00 /interactive tsshutdn 1800 /powerdown

2 boxes will appear. 1 DOS BOX which users can press Ctrl-C to cancel and a SYSTEM SHUTDOWN notification.

bosn1Author Commented:
I have a package built that provides the user with a 30 minute warning and the option to cancel the shutdown.  The warning has a countdown timer that shows  the user how time they have left and a cancel button.  If the user doesn't hit cancel the shuts down.  The package also logs the date/time, computer and user name.  If the user hit cancels the package adds "Shutdown canceled by (user name)" to the log file.  

I am stuggling with how to add the process as a scheduled task that will run under any user condition and be visible to any user that is logged in.
The /interactive switch shows your GUI to the User.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I use this with my packaged reboot timer. Works great.

Although I also added to my reboot timer if user is not logged in to reboot now instead of waiting the desired timeout.
My package resides on the server so if I needed to change it a can without having to revisit the workstations again.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Legacy OS

From novice to tech pro — start learning today.