Solved

vbscript run from Task Scheduler does not appear to end

Posted on 2016-09-07
7
44 Views
Last Modified: 2016-09-11
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?
0
Comment
Question by:Dale Fye (Access MVP)
  • 4
  • 3
7 Comments
 
LVL 23

Expert Comment

by:NVIT
ID: 41788458
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".
0
 
LVL 47

Author Comment

by:Dale Fye (Access MVP)
ID: 41788481
all of the paths used in the script are fully qualified network paths.

Checking on the userids of the scheduler vs my login.
0
 
LVL 47

Author Comment

by:Dale Fye (Access MVP)
ID: 41788596
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.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 23

Accepted Solution

by:
NVIT earned 500 total points
ID: 41788607
> ...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...
0
 
LVL 47

Author Comment

by:Dale Fye (Access MVP)
ID: 41788628
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?
0
 
LVL 23

Expert Comment

by:NVIT
ID: 41788741
Can you show what your task Actions tab setup looks like?
0
 
LVL 47

Author Comment

by:Dale Fye (Access MVP)
ID: 41790562
NVIT,

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

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Best way of mitigating threat from USB flash drives 9 91
Not showing JavaScript in the list 5 36
Deploying applications with MDT 2 14
File and print server with Ubuntu? 7 23
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

919 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

14 Experts available now in Live!

Get 1:1 Help Now