Tag: VBS

php exec vbs脚本只能在循环中第一次使用

我正在脚本来将Excel文件转换成CSV文件。 Excel文件在下载文件夹中,并以“START”开始。 只有第一个文件被转换,然后PHP仍在运行,但没有任何反应。 从浏览器运行它,我可以看到这个圆圈永远在运行,就像加载网站一样。 这是代码: $path = "C:\Users\\tom\Downloads\\"; foreach(glob($path."*.xls") as $excel_file) { $substr = substr($excel_file, 24, 5); if($substr = "START") { $csv_file = str_replace(".xls", ".csv", $excel_file); exec("$path"."csv.vbs $excel_file $csv_file"); } } 我使用的脚本是csv.vbs脚本,代码是: if WScript.Arguments.Count < 2 Then WScript.Echo "Error! Please specify the source path and the destination. Usage: XlsToCsv SourcePath.xls Destination.csv" Wscript.Quit End If Dim […]