How to modify a .txt file using .bat?

Solved
TheKiller3-johan Posted messages 28 Status Membre -  
TheKiller3-johan Posted messages 28 Status Membre -
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 réponse

fabul Posted messages 42114 Registration date   Status Modérateur Last intervention   6 036
 
Hi,

echo contact >> %Path%
0
TheKiller3-johan Posted messages 28 Status Membre 31
 
I didn't understand everything, can you explain it to me?
0
fabul Posted messages 42114 Registration date   Status Modérateur Last intervention   6 036 > TheKiller3-johan Posted messages 28 Status Membre
 
Can you tell me where your text file is located?

And/or what it is named?
0
TheKiller3-johan Posted messages 28 Status Membre 31 > fabul Posted messages 42114 Registration date   Status Modérateur Last intervention  
 
Of course, my text file is located at: C:\Users\Megaport\Desktop\test\test.txt
0
fabul Posted messages 42114 Registration date   Status Modérateur Last intervention   6 036 > TheKiller3-johan Posted messages 28 Status Membre
 
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
TheKiller3-johan Posted messages 28 Status Membre 31 > fabul Posted messages 42114 Registration date   Status Modérateur Last intervention  
 

echo The text you want >> %lenomdetontxt.txt 

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

Thank you very much!
0