1. #1
    Unregistered

    How to create an xml-file via a bat-file in Windows Vista on Sony laptop?

    I wish to create an xml-file via a bat-file in Windows Vista on my Sony laptop. Can you please help me with this by mentioning the necessary details to do it?



  2. #2
    gpzz Array
    Join Date
    Sep 2013
    Posts
    6

    Re: How to create an xml-file via a bat-file in Windows Vista on Sony laptop?

    It's very simple. you can create any type of file with some text as follows:
    For your question, here is an example of creating an xml file using batch script:

    echo ^<xml^> > "C:\sample.xml"
    echo ^<os^>Windows^</os^> >> "C:\sample.xml"
    echo ^</xml^> >> "C:\sample.xml"

    Explanation:
    the '^' (caret) character is used to escape < and > characters.
    the '>' character followed by file name is used to create a new file with echo content
    the '>>' is used to append content

    Note: you may need to choose "Run as administrator". because this example creates the file in C:\ drive. ( else you may get "Access denied" error )

+ Reply to Thread

Similar Threads

  1. Replies: 5
    Last Post: 19-09-2013, 01:58 PM
  2. Replies: 7
    Last Post: 31-05-2013, 08:43 PM
  3. Replies: 7
    Last Post: 17-12-2012, 11:27 PM
  4. Replies: 3
    Last Post: 31-08-2012, 11:20 PM
  5. Replies: 2
    Last Post: 30-07-2012, 02:33 PM