vbscript run from Task Scheduler does not appear to end

Dale Fye
Dale Fye used Ask the Experts™
on
I have a VB script file which runs properly when I simply click on the file and completes within 30 seconds.

But when I run this script from Task Scheduler, it hangs, with a status of "Running".  When I look at the History, it looks like (in reverse order)

2:17:13  110  Task triggered by user
2:17:13  319  Task Engine received message to start
2:17:13  100  Task Started
2:17:13  200  Action started
2:17:13  129  Created task Process

at 2:34 it still has  a status of "Running"

There is a wscript.exe file showing up in the running processes in my Task Manager.  When I manually remove that file from the task manager and refresh the Task Scheduler, the status of the task changes to "Ready"


Any ideas?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
NVITEnd-user support

Commented:
Does your run as a different user than the one it succeeds with when clicked?
Does the script access a mapped drive letter? If so, that letter may need to be mapped inside of the script.

Also, In the General tab, Security Options, What is chosen? Also set "Run with highest privileges".
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Author

Commented:
all of the paths used in the script are fully qualified network paths.

Checking on the userids of the scheduler vs my login.
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Author

Commented:
OK, when I run the scripts manually, logged in as me, they run fine.  I see the wscript.exe file pop up briefly in my Task Manager - Processes, and when I close the message displayed at the end of the script, the wscript.exe file disappears.

When I open the script, manually, when logged in as the BackupAdmin, which is the account that runs the task manager, it runs properly as well, displaying wscript.exe briefly in the Task Manager - Processes, and then disappearing.

I then remarked out the wscript.echo commands in the script file, but when I click the task in task scheduler and then click Run, it just hangs displaying 'Running', although i don't see a wscript.exe file showing in the Task Manager.  Which may correspond to the "Creating Task Process" message in the history.
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

End-user support
Commented:
> ...when I close the message displayed at the end of the script, the wscript.exe file disappears
> ...I then remarked out the wscript.echo commands in the script file

And there are no other script lines that show dialog/message boxes, which would cause the 'hanging', i.e. it's waiting for the user to close the dialog?

Hmm...
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Author

Commented:
no, i did a search of the script file and did not see any other wscript.echo commands.

Are there other vbscript commands which would create a dialog/message box?
NVITEnd-user support

Commented:
Can you show what your task Actions tab setup looks like?
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Author

Commented:
NVIT,

I'm going to pause on this for a bit.  Will get back to you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial