Solved

Scheduled task isn't opening a web browser

Posted on 2011-09-13
7
357 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
Comment Utility
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
Comment Utility
Sure, could you send me a sample of how I would do that?
0
 
LVL 8

Expert Comment

by:Amitabh Singh
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:chshelpdesk
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
@marcustech, looks like the command line approach works great.  Although for windows 2003 the command looks to be tinget.

Thanks!!
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

by Batuhan Cetin In this article I will be guiding through the process of removing a failed DC metadata from Active Directory (hereafter, AD) using the ntdsutil tool in a Windows Server 2003 environment. These steps are not necessary in a Win…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

10 Experts available now in Live!

Get 1:1 Help Now