Solved

Scheduled task isn't opening a web browser

Posted on 2011-09-13
7
361 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This may not be a text book method to resolve VSS backup issues but it seemed to have worked on few of the Windows 2003 servers we had issues while performing a Volume Shadow Copy backup. If you have issues while performing a shadow copy backup usin…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

733 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