Solved

Run a scheduled task in the foreground

Posted on 2004-04-26
9
4,920 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
 

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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Most of the time we are in fix when all of sudden our systems behave weirdly.  Such problems cost time and effort... so it's best to take some preventive actions so that we can avoid such issues or overcome such problems more easily. Preventive M…
Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now