View Single Post
  #104  
Old 23.05.2017, 09:12
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by Fireman449 View Post
I think the problem depends on the drive mapping cause the Log File is generated on "C:\temp" well but the script dont delete the files on drive Z:.
Troubleshoot the batch file using:

Code:
alert(callSync("cmd","/c","c:/myFolder/myBatch.bat"));// Log to screen (Dialog Box)
OR
Code:
log(callSync("cmd","/c","c:/myFolder/myBatch.bat"));// Log to file  "<JD>\logs\<sessionID>\ScriptEnvironment.log.0"

Alternatively, the folders can also be removed directly from event scripter
Code:
// Delete junk folders
// Trigger: "Archive Extraction Finished"

var archiveFolder = archive.getExtractToFolder(); // <- Will dynamically get the folder from 'archive info'. Can also set static folder.
var junkFolders = ["proof", "sample"]; // <- Specify folders to delete.

for (i = 0; i < junkFolders.length; i++) {
    var junkFolder = getPath(archiveFolder + "/" + junkFolders[i]);
    if (junkFolder.exists()) junkFolder.deleteRecursive();
}
Reply With Quote