Solved

Passing variables (or switches?) using HREF ?

Posted on 2003-11-17
4
285 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

Industry Leaders: 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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Find out what you should include to make the best professional email signature for your organization.
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…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

751 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