我想寫一個批處理文件。這看起來對特定的文件夾中,需要他們的路徑,並使用它們用於調用Java腳本:例如:我在桌面上的文件夾cbacklog包括的* .xls文件和我有一個converter.js Java腳本。我想在cbacklog如果它有excell文件,我將採取此文件路徑並呼籲converter.js轉換器將轉換此文件。然後批處理文件將移動到下一個EXCELL文件...取其拍並將其用於convert.js在一個文件夾中搜索批處理
var fso = new ActiveXObject("Scripting.FileSystemObject");
var xls03Path = WScript.Arguments(0);
xls03Path = fso.GetAbsolutePathName(xls03Path);
var xls95Path = xls03Path.replace("cbacklog", "dbacklog");
xls95Path =xls95Path.replace(/\.xls[^.]*$/, ".xls");
var objExcel = null;
try
{
WScript.Echo("Saving '" + xls03Path + "' as '" + xls95Path + "'...");
objExcel = new ActiveXObject("Excel.Application");
objExcel.Visible = false;
var objExcl = objExcel.Workbooks.Open(xls03Path);
var wdFormatxls = 39;
objExcl.SaveAs(xls95Path, wdFormatxls);
objExcl.Close();
fso.MoveFile(xls03Path,"C:\\Users\\cguneyel\\Desktop\\cbacklog\\processed\\");
}
finally
{
if (objExcl != null)
{
objExcl.Quit();
}
}
我現在只有java腳本@ r3ap3r – user32