Kaseya Community

Writing to a File

  • Hi All, Has anyone had issues with writing out to a file? eg When you set text to write to a file of "hello world!" it will place "hello world! " followed by an enter. This means if you are trying to write a batach file or config file out it has a trailing space? Is it something that we are doing wrong?? Regards,
  • post code

  • Procedure MyFirstScript.xml
    Please find attached the xml procedure.
  • test.txt

    Please find attached a copy of the file that is written

  • Yes it does .

    i think this has come up before and is why i use execute shell command and echo what i want to the text file instead

  • I've used the execute shell command in some cases to get around some issues when I want to generate a log of a bunch of stuff (obviously depends what you're doing though), something like this-  

    Create new file-

    echo do something >> #vAgentConfiguration.AgentTempDir#\log.txt

    Append to file-

    echo do something >>>> #vAgentConfiguration.AgentTempDir#\log.txt

    New line-

    echo[ >> #vAgentConfiguration.AgentTempDir#\Log.txt