Solved

Hyper links with VB script

Posted on 2011-02-21
7
250 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
  • 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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 142

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

786 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