JScript基础

JScript对大小写敏感同时很依赖括号,如WScript.Echo (“Hello, world")

"\"在JScipt中是转义字符,所以路径用”\\"表示

举例用相对路径下的PotPlayer打开当相对路径下的文件

filename = "1 2.flv"
var WshShell = WScript.CreateObject("WScript.Shell")
var str = WScript.ScriptFullName.substr(0, WScript.ScriptFullName.lastIndexOf("\\"));
// WshShell.Run (str + "\\PotPlayer\\PotPlayerMini.exe" + " " + str + "\\" + filename);
WshShell.Run ("\"" + str + "\\PotPlayer\\PotPlayerMini.exe" + "\"" + " " + "\"" + str + "\\" + filename + "\"");
// " "是必须的

 

posted @ 2013-11-13 14:03  cnsealine  阅读(259)  评论(0编辑  收藏  举报