BAT_FILE=getActualInspectionDir() + "\Confirm.bat" Inspection_FILE=getActualInspectionDir() + "\inspection" if fileExists(BAT_FILE)==true then deleteFile(BAT_FILE) endif addToFile(BAT_FILE,"attrib"+ chr(32) + "-r" + chr(32) + chr(34) + Inspection_FILE + chr(34)) systemCallWithWait(BAT_FILE) Z=confirm("Save the plan?") if Z==false then deleteFile(BAT_FILE) addToFile(BAT_FILE,"attrib"+ chr(32) + "+r" + chr(32) + chr(34) + Inspection_FILE + chr(34)) systemCallWithWait(BAT_FILE) endif