Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Opening an Application!

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,49229
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Opening an Application!
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Opening an Application! - 7/9/2007 11:12:50 PM   
  mtber

 

Posts: 35
Score: 0
Joined: 7/9/2007
Status: offline
Hi,

I am very new to VBS. i am creating a script that maps network drives but i do not like the original way it turned out because each time the script goes to map a drive it calls IE each time and this causes a new window to be open. i am trying to make the script so that it will open up IE only once in the beggining and then run the script to map the drives. can anyone help please.
 
 
Post #: 1
 
 RE: Opening an Application! - 7/9/2007 11:20:41 PM   
  LANlazy

 

Posts: 82
Score: 0
Joined: 4/11/2007
Status: offline
Can you post the script so I can see what you are working with?

(in reply to mtber)
 
 
Post #: 2
 
 RE: Opening an Application! - 7/9/2007 11:33:32 PM   
  mtber

 

Posts: 35
Score: 0
Joined: 7/9/2007
Status: offline

      
This is the code so far. i am trying to make a table to display what drives are being mapped at that time and that is why i want to have IE open only once and then have the code for the table and the drives run inside of IE.

< Message edited by ebgreen -- 7/10/2007 4:15:26 AM >

(in reply to mtber)
 
 
Post #: 3
 
 RE: Opening an Application! - 7/9/2007 11:40:48 PM   
  mtber

 

Posts: 35
Score: 0
Joined: 7/9/2007
Status: offline

      
This is the code so far. i am trying to make a table to display what drives are being mapped at that time and that is why i want to have IE open only once and then have the code for the table and the drives run inside of IE.

< Message edited by ebgreen -- 7/10/2007 4:16:01 AM >

(in reply to mtber)
 
 
Post #: 4
 
 RE: Opening an Application! - 7/10/2007 12:58:55 AM   
  RobertParker

 

Posts: 24
Score: 2
Joined: 6/8/2007
Status: offline
wow that is a lot of code. Is Modeless opening up a new IE window each time?  It seems like you overcomplicated everything in your code.  Here is how I wrote an IE window into my drive mapping script.


At the beginning of the script, this piece of code creates a new window:

Set objExplorer = CreateObject("InternetExplorer.Application")
Do While (objExplorer.Busy)
' If explorer is busy, sleep for 0.1 seconds and check again, loop until explorer isn't busy
WScript.sleep 100
Loop
objExplorer.Navigate "about:blank"  
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Visible = 1
html = "<center><img src='companyLogo.gif''></center><font face='Arial Narrow'><ul>"
objExplorer.Document.Title = "Logon script in progress"
objExplorer.Document.Body.scroll="no"
objExplorer.Document.Body.InnerHTML = html


Then I have this subroutine to add more text to the window:

Sub addText(data)
html = html & "<li>" & data & "</li>"
objExplorer.Document.Body.InnerHTML = html
End Sub


It adds the text as bullets to the IE window, and updates the window each time.

addText "Logon script starting up"
addText "Mapping G: Drive"
addText "Mapping printers"
addText "Script finished"

would look like
  • logon script starting up
  • Mapping G: Drive
  • Mapping Printers
  • Script Finished
But you could change the html to do whatever your current script is trying to do.

< Message edited by RobertParker -- 7/10/2007 1:01:28 AM >

(in reply to mtber)
 
 
Post #: 5
 
 RE: Opening an Application! - 7/10/2007 1:31:38 AM   
  mtber

 

Posts: 35
Score: 0
Joined: 7/9/2007
Status: offline
This is what i tried but i am getting an expected statement error and i have no idea how to fix it.

      

< Message edited by ebgreen -- 7/10/2007 4:16:30 AM >

(in reply to RobertParker)
 
 
Post #: 6
 
 RE: Opening an Application! - 7/10/2007 4:17:26 AM   
  ebgreen


Posts: 5250
Score: 31
Joined: 7/12/2005
Status: offline
For the love of all that is good and decent in the world and to prevent me from having to replace my mouse wheel, please use code tags.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to mtber)
 
 
Post #: 7
 
 RE: Opening an Application! - 7/10/2007 11:17:42 PM   
  mtber

 

Posts: 35
Score: 0
Joined: 7/9/2007
Status: offline
This is the part of the code that is opening IE and you can see where it opens it each time a drive is being mapped.


      

(in reply to ebgreen)
 
 
Post #: 8
 
 RE: Opening an Application! - 7/10/2007 11:45:51 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
RobertParker I like the sub and included it into my script.

Before I had a bunch of
objExplorer.Document.Body.InnerHTML = "<h4><font face=arial color=#306EFF> Mapping Network Drives...</h4>"

So I just changed your Sub [html] to do the same

Sub addText(data)
html = html & "<h4><font face=arial color=#306EFF>" & data & "</h4>&qu