D
DL
The following code to launch Windows Paint program with an image file
failed. The problem seems related to the location of the image file
under the Program Files folder (for the white space between the two
words).
<script language="JScript">
function runPaint(f) {
prog = "mspaint.exe C:\\'Program Files'\\myProgram\\myImageFiles'+f;
WSH = new ActiveXObject("WScript.Shell");
WSH.run(prog);
}
</script>
Had the image file located in a folder without spaces, say, Paint,
then, the following code would work,
<script language="JScript">
function runPaint(f) {
prog = "mspaint.exe C:\\Paint\\myImageFiles'+f;
WSH = new ActiveXObject("WScript.Shell");
WSH.run(prog);
}
</script>
I can't change the image location, how to escape the white space? how
to solve it?
Thanks.
failed. The problem seems related to the location of the image file
under the Program Files folder (for the white space between the two
words).
<script language="JScript">
function runPaint(f) {
prog = "mspaint.exe C:\\'Program Files'\\myProgram\\myImageFiles'+f;
WSH = new ActiveXObject("WScript.Shell");
WSH.run(prog);
}
</script>
Had the image file located in a folder without spaces, say, Paint,
then, the following code would work,
<script language="JScript">
function runPaint(f) {
prog = "mspaint.exe C:\\Paint\\myImageFiles'+f;
WSH = new ActiveXObject("WScript.Shell");
WSH.run(prog);
}
</script>
I can't change the image location, how to escape the white space? how
to solve it?
Thanks.