Solved

GP Script to Open IE Window on Login

Posted on 2004-03-29
6
1,962 Views
Last Modified: 2013-12-19
i'm using a vbscript to open IE to a particular webpage (our intranet page) when a user logs in. my problem is that not all users have their screen resolution set to 1024x768 which is what i've written the script to run best at. is there a simple way to get the window to size itself to the maximum available space? if not, what is the vbscript command to make the window startup maximized (not IE fullscreen since the users are unlikely to know how to close it)? the script i've written is:

dim ie
set ie=createobject("internetexplorer.application")

ie.navigate"http://intranet"
ie.toolbar=0
ie.statusbar=0
ie.Top=0
ie.Left=0
ie.Width=1024
ie.Height=740
ie.visible=true
0
Comment
Question by:craskin
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:following
ID: 10715448
You could try using ie.document.parentWindow.screen.width and ie.document.parentWindow.screen.height to set variables to the current resolution and then feed those into ie.Width and ie.Height.

I'll try to post an example shortly.

Hope this helps,
-jdm

0
 
LVL 3

Expert Comment

by:following
ID: 10715560
This should do the trick:

dim ie
set ie=createobject("internetexplorer.application")
ie.navigate"http://intranet"
ie.toolbar=0
ie.statusbar=0
ie.Top=0
ie.Left=0
ie.visible=true
ie.Width=ie.document.parentwindow.screen.availWidth
ie.Height=ie.document.parentwindow.screen.availHeight

Note: I used availWidth and availHeight in the example since that ensures that the ie object will not overlap the taskbar.

Hope this helps,
-jdm
0
 
LVL 12

Author Comment

by:craskin
ID: 10716077
generated error code 80004005.
0
Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

 
LVL 3

Accepted Solution

by:
following earned 50 total points
ID: 10716794
I think that's because we are trying to change properties before the object is fully instantiated.  Try this:

Dim ie
Set ie=createobject("internetexplorer.application")
With ie
    .navigate "about:blank"
    Do Until .readyState=4
      WScript.Sleep 10
    Loop
    .toolbar=0
    .statusbar=0
    .Top=0
    .Left=0
    .Width=ie.document.parentwindow.screen.availWidth
    .Height=ie.document.parentwindow.screen.availHeight
    .navigate "http://intranet"
    .visible=true
End With
0
 
LVL 12

Author Comment

by:craskin
ID: 10716958
excellent! it worked!
0
 

Expert Comment

by:vicky1982
ID: 26208122
can you Please suggesth how can i set user default page set by them , script will not change thier page only it will open site which we want in the Last Line.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
This is the first one of a series of articles I’ll be writing to address technical issues that are always referred to as network problems. The network boundaries have changed, therefore having an understanding of how each piece in the network  puzzl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
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 …

930 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

11 Experts available now in Live!

Get 1:1 Help Now