?
Solved

Hyper links with VB script

Posted on 2011-02-21
7
Medium Priority
?
264 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 2000 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 2000 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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
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 …
Suggested Courses

801 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