objArgs = WScript.Arguments; var sOutput = validateFile(objArgs(0)); if (sOutput != "") { WScript.Echo(sOutput); } function validateFile(strFile) { // Create an XML DOMDocument object. var x = new ActiveXObject("MSXML2.DOMDocument.4.0"); //Load and validate the specified file into the DOM. x.async = false; x.validateOnParse = true; x.resolveExternals = true; x.load(strFile); // Return validation results in message to the user. if (x.parseError.errorCode != 0) { return("Errore di validazione file: " + strFile + "\n=====================" + "\nMotivo: " + x.parseError.reason + "\nSorgente: " + x.parseError.srcText + "\nLinea: " + x.parseError.line + "\n"); } else return(""); }