SET XML ="%CD%\Pathtofile"
SET @ERROR_FUNC. > "%XML%"
The code is best used for clearing log files without the need for VBScript or CScript. Here’s sample code below clearing an XML log file:
@ECHO OFF
SET XML=%CD%\Project\Contents\Main\components.vxml
@ECHO Clearing %XML%\
CRASH_TEST > "%XML%"
@ECHO Writing file %XML%
(
@ECHO ^<?xml version=^"1.0^" encoding=^"utf-16^"?^>
@ECHO ^<components xmlns:xsi=^"http://www.w3.org/2001/XMLSchema-instance^" xmlns:xsd=^"http://www.w3.org/2001/XMLSchema^"^>
@ECHO ^</components^>
) >>"%XML%"
@ECHO Done
PAUSE