Hi,
I am trying to write a batch file to open a file(.txt) in a specified location,save the file and then close the file again.
Is it possible to execute these commands using a batch file? I can write the command to open, but cannot seem to save and close it.
Thanks in advance.
Open a file, save it and close it using a Batch File
Moderator: DosItHelp
-
- Posts: 3
- Joined: 27 Sep 2012 08:53
Re: Open a file, save it and close it using a Batch File
the_caretaker wrote:I am trying to write a batch file to open a file(.txt) in a specified location,save the file and then close the file again.
Is it possible to execute these commands using a batch file? I can write the command to open, but cannot seem to save and close it.
How are you opening it?
Do you want to add text to an existing file?
This will add a line at the bottom of a file.txt file. It automatically gets saved.
Code: Select all
>>file.txt echo new line at the bottom
-
- Posts: 3
- Joined: 27 Sep 2012 08:53
Re: Open a file, save it and close it using a Batch File
Hi, thanks for the replies.
No I don't need to add any text, I just need to save it i.e. update Date Modified.
Thanks
No I don't need to add any text, I just need to save it i.e. update Date Modified.
Thanks
Re: Open a file, save it and close it using a Batch File
Code: Select all
COPY /B file.txt +,,
Going forward please state what your intended goal is in your question.
-
- Posts: 3
- Joined: 27 Sep 2012 08:53
Re: Open a file, save it and close it using a Batch File
Thanks Squashman,
this was really helpful.
this was really helpful.