Answer the question
In order to leave comments, you need to log in
How to write text to a file using bat without quotes?
Hello, there is a text that needs to be written in XML
$xml = "<InputSettings> <InputSetting> <Name>id_rk</Name>";
$cmd = "cmd /c echo '{$xml}' > 'C:\\file.xml'";
$stream = ssh2_exec($connection, $cmd);
Answer the question
In order to leave comments, you need to log in
$cmd = "cmd /c echo '{$xml}' > 'C:\\file.xml'";
And is it necessary to do this through bat?
file_put_contents ('c:\file.xml' , $xml, FILE_APPEND);
php.net/manual/en/function.file-put-contents.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question