Results 1 to 6 of 6

Thread: open url - please help....desperate!

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870

    open url - please help....desperate!

    hi,

    i have the following code in a vbscript file setup.vbs

    Can someone provide me with the code to open the file index.htm if they click on no to the install bit.

    Code:
    option explicit
    
    dim retval
    Dim objFSO
    
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    
    
    retval = msgbox("Would you like to install this CD to your c:\?", _
    	vbYesNo + vbQuestion, "Electronic product catalogue")
    
    if retval = vbYes then
    	' Copy / install stuff her
    	If Not objFSO.FolderExists("C:\BBAreman") then
    		objFSO.CreateFolder("C:\BBAreman")
    		objFSO.CreateFolder("C:\BBAreman\bba")
    		objFSO.CreateFolder("C:\BBAreman\bba\catalogue")
    		objFSO.CreateFolder("C:\BBAreman\bba\images")
    		objFSO.CreateFolder("C:\BBAreman\bba\rotating")
    		objFSO.CreateFolder("C:\BBAreman\bba\rotating\alternators")
    		objFSO.CreateFolder("C:\BBAreman\bba\rotating\starters")
    		objFSO.CreateFolder("C:\BBAreman\bba\rotating\images")
    	
    		objFSO.CopyFile "index.htm", "c:\BBAreman\"
    		objFSO.CopyFile "bba\*.*", "c:\BBAreman\bba\"
    		objFSO.CopyFile "bba\catalogue\*.*", "c:\BBAreman\bba\catalogue\"
    		objFSO.CopyFile "bba\images\*.*", "c:\BBAreman\bba\images\"
    		objFSO.CopyFile "bba\rotating\*.*", "c:\BBAreman\bba\rotating\"
    		objFSO.CopyFile "bba\rotating\alternators\*.*", "c:\BBAreman\bba\rotating\alternators\"
    		objFSO.CopyFile "bba\rotating\starters\*.*", "c:\BBAreman\bba\rotating\starters\"
    		objFSO.CopyFile "bba\rotating\images\*.*", "c:\BBAreman\bba\rotating\images\"
    	else
    		msgbox("CD has already been copied to c:\BBAreman")
    	
    	end if	
    else
    	' Open IE with file index.htm
    end if
    please help me i'm desperate!

    Thanks
    nick

  2. #2
    Junior Member
    Join Date
    Feb 2002
    Location
    Canada
    Posts
    30
    Here's a code snippet which will create and open a new browser window. You may have to play with it a bit to get the effect you want.

    Dim ieWin
    Set ieWin = CreateObject("InternetExplorer.Application")
    ieWin.Navigate "http://www.microsoft.com"
    ieWin.Application.Visible=True

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    thanks sean

    you have saved a young mans mind!

    how do i get the window maximised as at the mo it minimized.

    Thanks again

    Nick

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    also,

    when i try to open my file index.htm, it looks for http://index.htm. How can i get it to look in the same directory as the vb script?

  5. #5
    Junior Member
    Join Date
    Feb 2002
    Location
    Canada
    Posts
    30
    To get it to open a File and Maximize use:

    Dim ieWin
    Set ieWin = CreateObject("InternetExplorer.Application")

    ieWin.Navigate "File://c:\index.html"
    ieWin.Application.Visible=True

    ieWin.application.FullScreen=True
    msgbox("Click Ok to close.")

    ieWin.Application.Visible=False
    Set ieWin = Nothing

    I think there's probably a much better way to do this, but it seems to work.

  6. #6
    New Member
    Join Date
    Mar 2003
    Location
    Mexico City
    Posts
    13
    I use an html / shelexe / autorun.txt

    I hope it works for you

    open_html.ZIP
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width