Multiple instances of cscript.exe

I have a scheduled task that runs an executable that kicks off a .vbs script every morning.  The vbs script is a notification pop up.  Since the computers are not being restarted, there are multiple instances of cscript.exe running, sometimes up to 30 processes (the computer was on for weeks).  I have tried updating to Windows Script 5.7.  When the executable is launched, cscript.exe process will not end.  Is there a fix to end the cscript.exe process after it executes?  
LVL 1
POINTGREENAsked:
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.

johnb6767Commented:
Just include the command to kick off the scheduled Task, in a batch file.


Posted the same in the other one, just to be safe........
 @echo off 
"Path To Your Your.exe" 
taskkill.exe /f /im cscript.exe 

Open in new window

0

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
AmazingTechCommented:
What is this VBS script popping up? So each time it's waiting for this notification to be acknowledged?
0
POINTGREENAuthor Commented:
Yes, it's just information for the user, one pops up in the morning; another pops up every 2 weeks.  The user clicks OK to acknowledge.  
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

AmazingTechCommented:
So after the user clicks OK to acknowledge the cscript.exe is still running? Can you post an example of this code so we can try and duplicate the problem. Perhaps there's an alternative way to popup this message to have cscript close properly.
0
AmazingTechCommented:
How did you setup your scheduled task? Is it running as system? Does it run even if a user is not logged in?
0
POINTGREENAuthor Commented:
Yes, funny part of it is--The scheduled task was originally setup to run as "NT Authority System" account.  But, if we create a new task that runs as the current user, it works.  It will not work as the local administrator.  Yes, after the user hits OK, cscript.exe is still running.  I tried doing what johnb6767 suggested, and that works.  But I'm curious of other methods, and why the NT Authority System account is no longer working.  
0
AmazingTechCommented:
If it was previously running as System then chances are it was setup using the AT command with /interactive so it can popup with the logged on user account instead of popping up in the system's account (which is nonexistent and would wait forever because no one sees it). Obviously if the scheduled tasks running under system and there's no one logged in the interactive is no user but the popup window would still pop up and wait forever.

I would check for explorer.exe running. If so then there is a user logged in so popup notiification.

tasklist | find /i "explorer.exe"
if not errorlevel 1 cscript //nologo notify.vbs
0
POINTGREENAuthor Commented:
Amazing Tech, the task won't run, even if I'm logged in.  
0
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
Document Imaging

From novice to tech pro — start learning today.