Solved

Passing variables (or switches?) using HREF ?

Posted on 2003-11-17
4
289 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
[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
  • 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

Independent Software Vendors: 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!

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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 Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

615 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