Solved

Hyper links with VB script

Posted on 2011-02-21
7
257 Views
Last Modified: 2012-05-11
I want to include a hyperlink in the following network logon script, Do you know how this can be achieved?
<html>
<head>
<title>Network Drives</title>
<HTA:APPLICATION
  APPLICATIONNAME="Network Drives!"
  ID="myNetworkDrives"
  VERSION="1.0"
/>
</head>

<script language="VBScript">

Sub Window_OnLoad
  'This method will be called when the application loads
  'Add your code here
  window.resizeto 640,480
  window.resizeto 640,480
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  strPath = objFSO.GetAbsolutePathName(".")
  Set objFolder = objFSO.GetFolder(strPath)
  jpgList = ""

  For Each objFile In objFolder.Files
    If InStr(objFile.Name, "NetDrv") <> 0 Then 
      jpgList = jpgList & objFile.Name & "|"
    End If
  Next
  jpgList = Split(jpgList,"|")
  window.document.body.background = jpgList(getRandomNumber(0, UBound(jpgList)-1))

End Sub

Function getRandomNumber(low,high)
  intHighNumber = high
  intLowNumber = low
  Randomize
  getRandomNumber = Int((intHighNumber - intLowNumber + 1) * Rnd + intLowNumber)
End Function
</script>
</body>

</html>

Open in new window

0
Comment
Question by:resolver1
[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
7 Comments
 
LVL 6

Accepted Solution

by:
TinTombStone earned 500 total points
ID: 34943446
Replace Line 40 on, with


<body bgcolor="buttonface">
<a href="http://www.experts-exchange.com/" target="blank">Expert Zone</a href>
</body>
</html>
0
 

Author Comment

by:resolver1
ID: 34944482
Thanks for your reply.  If I click the picture nothing happens.  I want to be able to click the whole of the window and for it to open IE and take users to an internal website.  All that happens with the code supplied is that it adds expert zone at the top left in text.
0
 
LVL 6

Assisted Solution

by:TinTombStone
TinTombStone earned 500 total points
ID: 34945579
This will hyperlink the whole window

<script language="VBScript">

Sub PopLink( )
Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Navigate "http://www.experts-exchange.com"   
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width=800
objExplorer.Height = 600
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1
End Sub

</script>

<body bgcolor="white" onclick="PopLink">

</body>
</html>
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:resolver1
ID: 35093969
Still goto check this one out.  Thanks for the reply.  
0
 

Author Comment

by:resolver1
ID: 35802942
I tried pasting the above code into a seperate html file and the link still wouldnt work.  It is something i would like to get to work.  
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35829888
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

737 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