Append two commands in a file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
hacxx
Posts: 57
Joined: 09 Apr 2015 13:18

Append two commands in a file

#1 Post by hacxx » 25 May 2015 10:58

Commonly to save a result into a file in batch, the cmd needs >

Example:
dir c:\windows\system32 > file.txt

but if i want to append a second command to file.txt how it should be done?

Example:
dir c:\windows\system32 > file.txt
dir c:\windows > file.txt

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: Append two commands in a file

#2 Post by ShadowThief » 25 May 2015 11:21

You can use dir c:\windows>>file.txt to add text to the end of a text file instead of overwriting it.

hacxx
Posts: 57
Joined: 09 Apr 2015 13:18

Re: Append two commands in a file

#3 Post by hacxx » 25 May 2015 12:49

Thanks ShadowThief

Post Reply