Solved

GP Script to Open IE Window on Login

Posted on 2004-03-29
6
1,965 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
[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
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
Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

 
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Downtime reduced, data recovered by utilizing an Experts Exchange Business Account Challenge The United States Marine Corps employs more than 200,000 active-duty Marines with operations in four continents, all requiring complex networking system…
We recently endured a series of broadcast storms that caused our ISP to shut us down for brief periods of time. After going through a multitude of tests, we determined that the issue was related to Intel NIC drivers on some new HP desktop computers …

710 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