Solved

Run a scheduled task in the foreground

Posted on 2004-04-26
9
5,136 Views
Last Modified: 2008-12-23
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
Comment
Question by:baal32
  • 4
  • 4
9 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 10922367
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
 

Author Comment

by:baal32
ID: 10922514
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
 
LVL 67

Expert Comment

by:sirbounty
ID: 10922526
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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

Author Comment

by:baal32
ID: 10922723
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
 
LVL 67

Expert Comment

by:sirbounty
ID: 10922745
Hmm - I might have to write a small script to test it - but can you schedule it with
Start /Max yourscript.vbs
0
 

Author Comment

by:baal32
ID: 10942094
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
 

Accepted Solution

by:
baal32 earned 0 total points
ID: 10943172
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
 
LVL 67

Expert Comment

by:sirbounty
ID: 10943276
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are 2 things you must have in order to connect to the internet behind a router, The "Gateway IP" of the router, which is usually something like 192.168.xxx.1, I've seen routers with default values of: 192.168.0.1, 192.168.1.1, 192.168.11.1, …
It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question