Solved

Scheduled task isn't opening a web browser

Posted on 2011-09-13
7
358 Views
Last Modified: 2012-05-12
I have a vbs script that is setup in a scheduled task that runs nightly.  It is supposed to open a web browser and go to a page that runs a script for us to update database information.  This task used to run fine, but recently it shows that the task ran and completed but looks like the web browser was never opened.  

I've tried setting up the task under the adminitrator and under a user with admin rights but neither seem to make a difference.

Here's the VBS file that we are using in the scheduled task.

Set wshShell = WScript.CreateObject("WScript.Shell")
wshShell.Run "iexplore http://mysite.com/mypage.aspx", 9
WScript.Sleep 3600000
wshShell.SendKeys "%F"
wshShell.SendKeys "C"

Open in new window

0
Comment
Question by:chshelpdesk
  • 3
  • 2
  • 2
7 Comments
 
LVL 12

Expert Comment

by:marcustech
ID: 36530353
Can you modify the VBS file to log it's progress to a text file after each line? This would at least narrow down the point at which it's failing.
0
 

Author Comment

by:chshelpdesk
ID: 36530553
Sure, could you send me a sample of how I would do that?
0
 
LVL 8

Expert Comment

by:Amitabh Singh
ID: 36530637
try this if its help you
 
Set wshShell = WScript.CreateObject("WScript.Shell")
wshShell.Run "cmd /c explorer http://google.com", 9
WScript.Sleep 10
wshShell.SendKeys "%F"
wshShell.SendKeys "C"

Open in new window

0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:chshelpdesk
ID: 36530827
Nope, that didn't work either.

As a note, the browser opens fine when I'm logged in.  But if I'm not logged in the browser will not open when the script runs.  Script shows as running successful though.
0
 
LVL 8

Expert Comment

by:Amitabh Singh
ID: 36536461
hmmm interesting , i know its possible to run cmd command and script via non interactive session (when user is not login )

but not sure about IE if their is possibility to run as non interactive session , i will test this in my Lab today i let you know after

but generally if you think about security point of view its: not possible to run any slandered GUI application  via schedule task when user is not login , its same like you want to run Microsoft word  as schedule task and some one delete some data on your server by using this !
0
 
LVL 12

Accepted Solution

by:
marcustech earned 250 total points
ID: 36539401
I'd imagine the browser wants an interactive session logged in in order to start, in which case you might find you either need to leave the session logged in, or use a command line http client, which actually seems like a more logical approach anyway. To write to a text file this should work:
 But I'm not sure it will actually be very informative to be honest.
0
 

Author Comment

by:chshelpdesk
ID: 36544169
@marcustech, looks like the command line approach works great.  Although for windows 2003 the command looks to be tinget.

Thanks!!
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

911 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

19 Experts available now in Live!

Get 1:1 Help Now