cmd.exe  write to another file

rgb192
rgb192 used Ask the Experts™
on
windows
cmd.exe

how to write a large output to another file
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Not sure what you mean by large output but you can use redirection.

Example:

set >> info.txt

Commented:
Try this: xcopy c:\temp /e

Also for issues with large files, try this:
http://www.howtogeek.com/howto/windows-vista/fix-problems-with-copying-large-files-in-windows-vista/

Author

Commented:
dir hello


and the 'hello' folder has many subfolders

write the response to another file
Acronis in Gartner 2019 MQ for datacenter backup

It is an honor to be featured in Gartner 2019 Magic Quadrant for Datacenter Backup and Recovery Solutions. Gartner’s MQ sets a high standard and earning a place on their grid is a great affirmation that Acronis is delivering on our mission to protect all data, apps, and systems.

Have you considered using robocopy?

robocopy C:\hello D:\hello /MIR /R:0

The will create a replica of the folder. If there are any changes and you rerun the command, it will capture only differentials. Lightning fast!
Steven CarnahanAssistant Vice President\Network Manager
Commented:
sounds like motnahp00's suggestions is what you are looking for:

dir hello >> c:\listing.txt

(use the location and name of the file of your choosing)
... let me add some info to it:

the ">" is actually redirecting the output wou would get on the screen into a file.
if you only use one ">", it will overwrite and ">>" will append to the file. the redirector is always at the end of the command.
You can also pipe ("|") the output to SORT (et al), and then redirect SORT's output to a file.
e.g.

C:\>dir c:\ | sort /+37 > %userprofile%\Documents\sorted.txt

which creates or overwrites a file named 'sorted.txt' in the current user's My Documents folder.

the 37th column is the first letter of the file and subdirectory names on my computer, by the way... that may or may not match your system.

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial