Solved

Passing variables (or switches?) using HREF ?

Posted on 2003-11-17
4
272 Views
Last Modified: 2010-04-09
Hi, I'd like to do the following:

Problem is, this works fine:

<a href="file://c:\pingit.bat">Ping It</a>

This however, doesn't:

<a href="file://c:\pingit.bat 192.168.0.147">Ping It</a>

So when you click on the link, it would call pingit.bat and pass it the IP address listed.

But as soon as you add a variable/switch to it, it fails to call the batch file at all.

Any ideas ?

0
Comment
Question by:JamesMonaghan
  • 2
4 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 9763823
something to try:

<a href="file://c:\pingit.bat?192.168.0.147">Ping It</a>
0
 

Author Comment

by:JamesMonaghan
ID: 9765770
Alas no...

Anyone else ?
0
 
LVL 3

Accepted Solution

by:
monvelasquez earned 250 total points
ID: 9768201
try it this way..

<html>
<head>
<script language="vbscript">

function pingIt(ByVal IPAddress)
Dim WSH
Set WSH = CreateObject("WScript.Shell")

WSH.Run "C:\Pingit.bat " & IPAddress

Set WSH = Nothing

end function
</script>
</head>
<body>

<a href="javascript:pingIt('192.168.0.147')">Ping It</a>
</body>

</html>
0
 

Author Comment

by:JamesMonaghan
ID: 9769992
Excellent, that worked perfectly, thanks very much!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now