Link to home
Start Free TrialLog in
Avatar of POINTGREEN
POINTGREENFlag for United States of America

asked on

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?  
ASKER CERTIFIED SOLUTION
Avatar of johnb6767
johnb6767
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AmazingTech
AmazingTech

What is this VBS script popping up? So each time it's waiting for this notification to be acknowledged?
Avatar of POINTGREEN

ASKER

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.  
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.
How did you setup your scheduled task? Is it running as system? Does it run even if a user is not logged in?
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.  
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
Amazing Tech, the task won't run, even if I'm logged in.