How to modify a .txt file using .bat?

Solved
TheKiller3-johan Posted messages 28 Status Member -  
TheKiller3-johan Posted messages 28 Status Member -
Hello, I am asking this question on the forum because
I do not know how to modify a .txt with a .bat

Example:
I want that in the .bat I can
add a sentence in a .txt "contact"

Thank you in advance

Best regards,
Johan

1 answer

  1. fabul Posted messages 42191 Registration date   Status Moderator Last intervention   6 070
     
    Hi,

    echo contact >> %Path%
    0
    1. TheKiller3-johan Posted messages 28 Status Member 31
       
      I didn't understand everything, can you explain it to me?
      0
      1. fabul Posted messages 42191 Registration date   Status Moderator Last intervention   6 070 > TheKiller3-johan Posted messages 28 Status Member
         
        Can you tell me where your text file is located?

        And/or what it is named?
        0
      2. TheKiller3-johan Posted messages 28 Status Member 31 > fabul Posted messages 42191 Registration date   Status Moderator Last intervention  
         
        Of course, my text file is located at: C:\Users\Megaport\Desktop\test\test.txt
        0
      3. fabul Posted messages 42191 Registration date   Status Moderator Last intervention   6 070 > TheKiller3-johan Posted messages 28 Status Member
         
        echo contact >> C:\Users\Megaport\Desktop\test\test.txt

        Or

        echo contact >> %UserProfile%\Desktop\test\test.txt

        Or

        (If your .bat is in the same folder as your .txt)

        echo contact >> %test.txt
        0
      4. TheKiller3-johan Posted messages 28 Status Member 31 > fabul Posted messages 42191 Registration date   Status Moderator Last intervention  
         

        echo The text you want >> %lenomdetontxt.txt 

        echo The text you want >> %UserProfile%\Desktop\lenomdeetontxt.txt 

        Thank you very much!
        0