Solved

GP Script to Open IE Window on Login

Posted on 2004-03-29
6
1,960 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
Comment Utility
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
Comment Utility
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
Comment Utility
generated error code 80004005.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 3

Accepted Solution

by:
following earned 50 total points
Comment Utility
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
Comment Utility
excellent! it worked!
0
 

Expert Comment

by:vicky1982
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Enterprise networks where VoIP phones have been deployed frequently use port configurations that allow both a computer and an IP phone to be plugged into the same switch port but use different VLANs. On Cisco equipment I'm referring to the "native V…
Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

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

11 Experts available now in Live!

Get 1:1 Help Now