Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quote path with spaces ? 3

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Feb 6, 2002
1,851
IL
HI,

When I run the below code and the file name has spaces in it ("My file") - the function does not work,because of the spaces.

<LI><a HREF="Javascript:void(0)" onclick="Run('jtbrowser.exe d:/temp/POD/JobTickets/My file');" >My file</A></li>

I tried quoting the string,got a browser error regarding the "unterminated string" :

<LI><a HREF="Javascript:void(0)" onclick="Run('jtbrowser.exe \"d:/temp/POD/JobTickets/My file\"');" >My file</A></li>

Appreciate any advise.
Thanks

Long live king Moshiach !
 
Hi

[tt]Run[/tt] ? Sure that is JavaScript ?

Anyway, I would try it in HTTP way :
Code:
<LI><a HREF="Javascript:void(0)" onclick="Run('jtbrowser.exe d:/temp/POD/JobTickets/My[red]+[/red]file');" >My file</A></li>

[gray]<!-- or -->[/gray]

<LI><a HREF="Javascript:void(0)" onclick="Run('jtbrowser.exe d:/temp/POD/JobTickets/My[red]%20[/red]file');" >My file</A></li>

Feherke.
 
Thanks,

both did not do the trick.

BTH - the funcion is a JS :

<script language='javascript'>
function Run(what) {
try {
WSH = new ActiveXObject("WScript.Shell");
WSH.Run(what)
}
catch(err) {
var txt = ""
if (what.match("dbviewer")) {
txt = "Trying to open .mdb file with MS Access."
what = (what.replace(/dbviewer.exe /,""))
WSH.Run(what)
} else if (what.match("TraceDecoder")) {
txt = "TraceDecoder.exe was not found on your desktop !"
alert(txt)
return true
} else if (what.match("jtbrowser")) {
txt = "JTbrowser.exe was not found on your system !"
txt += " .jtt files can only be viewed on a DFE ."
alert(txt)
return true
} else if (what.match("drwtsn32")) {
txt = "drwtsn32.exe was not found on your system !"
alert(txt)
return true
}
}
}
</SCRIPT>

Long live king Moshiach !
 
>onclick="Run('jtbrowser.exe d:/temp/POD/JobTickets/My file');"
[tt]onclick="Run('jtbrowser.exe [red]'+String.fromCharCode(34)+'[/red]d:/temp/POD/JobTickets/My file'[red]+String.fromCharCode(34)[/red]);" [/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top