[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5658
  • Last Modified:

Run a scheduled task in the foreground

Need to do it regardless of who is logged on to the system - the scheduled task consist of nothing more than a 1line vbscript to pop a message box stating that the library will be closing in 10 minutes - an administrative login will be used to create the task but it needs to pop the message interactively.
0
baal32
Asked:
baal32
  • 4
  • 4
1 Solution
 
sirbountyCommented:
Log in as the admin
Click Start->Run->CMD

AT 16:50 /every:m,t,w,th,f net send %computername% "The library will be closing in 10 minutes." <enter>

You can adjust the time and day(s) if needed - this is just for each weekday at 4:50pm
0
 
baal32Author Commented:
I appreciate the quick response but I'd really like to be able to have a vbscript run in the foreground (net send is very limited)
0
 
sirbountyCommented:
Just replace "net send ...." with the name of your script - make sure the script is stored in a folder that all users have access to...
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
baal32Author Commented:
The problem is when another user is logged in (other than the administrator who created the task) the vbscript runs in the background and suppresses console out put - if the same user is logged in as created the script, the vbscript runs normally and a msgbox appears but otherwise nothing happens (although if I check taskman I can see the wscript process running because the user is unable to see the msgbox and therefore click OK)
0
 
sirbountyCommented:
Hmm - I might have to write a small script to test it - but can you schedule it with
Start /Max yourscript.vbs
0
 
baal32Author Commented:
Still haven't managed to get this to work - I think the scheduled task service runs the task in the background if the current user != creating user.  This is probably by design but I'm trying to circumvent it.  I coudl perform various unattractive workarounds like having the system remotely message itself but...
0
 
baal32Author Commented:
Well...  I guess its kind of funny in a 'wasted 6 hours of my time' kind of way.  So AT, despite lacking all of the 'cool new improvements' added to the GUI task scheduler, has a very important /interactive switch which allows the process to run in the foreground.

So...  Finally figured it out
0
 
sirbountyCommented:
baal32 - sorry I've been tied up today.
Glad you got it working though...I completely forgot about that switch!  :D
I'll take care of refunding this one for you...
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now