I need to save the data of a java program into a file. The problem is, it returns a "The filename, directory name, or volume label syntax is incorrect" error when I add the %DATE% and %TIME% variables into the filename. Without the date time variables it works fine.
As well I need to output the result into the console and the file. As far as I have seen, there is no direct possibility to do so. Workaround: I'm just reading the file again into the console. When doing that with the date time variable, I get the same error.
set datetime="%DATE%-%TIME%"
java -Xmx1024m -jar org.hl7.fhir.validator.jar generated.json -version 4.0.1 -ig hl7.fhir.uv.livd > "errlog/%datetime%.log"
type "%CD%\errlog\%datetime%.log"
I never write batch files so could be a very "stupid" problem. Thanks in advance!