Solved

Hyper links with VB script

Posted on 2011-02-21
7
254 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

830 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