- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- cmd shell and commands
Operating System - Microsoft
1820475
Members
3304
Online
109624
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2007 07:03 PM
тАО09-27-2007 07:03 PM
Is there a tool or a command that will send the output of a command to a file?
We're running this sentence (netcat.exe):
nc -v esm9-vfpri1 515 < c:\WINDOWS\get.txt
We get this output:
DNS fwd/rev mismatch: esm9-vfpri1.vf-es.internal.vodafone.com != ESM9-VFPRI1
esm9-vfpri1.vf-es.internal.vodafone.com [10.229.28.104] 515 (printer) open
But when we try:
nc -v esm9-vfpri1 515 < c:\WINDOWS\get.txt > outputFile
the contents of outputFile is either 0 KB or 1 KB.
type outputfile returns:
├┐
Tnks.
We're running this sentence (netcat.exe):
nc -v esm9-vfpri1 515 < c:\WINDOWS\get.txt
We get this output:
DNS fwd/rev mismatch: esm9-vfpri1.vf-es.internal.vodafone.com != ESM9-VFPRI1
esm9-vfpri1.vf-es.internal.vodafone.com [10.229.28.104] 515 (printer) open
But when we try:
nc -v esm9-vfpri1 515 < c:\WINDOWS\get.txt > outputFile
the contents of outputFile is either 0 KB or 1 KB.
type outputfile returns:
├┐
Tnks.
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2007 05:36 AM
тАО09-29-2007 05:36 AM
Solution
Presumably the message is in the error stream and not the output stream (which you are capturing).
command 2> filename Redirect any error message into a file
(command) 2> filename Redirect any CMD.exe error into a file
command > file 2>&1 Redirect output and errors to one file
command > fileA 2> fileB Redirect output and errors to separate files
command 2>&1 >filename This will fail!
Note: While I am an HPE Employee, all of my comments (whether noted or not), are my own and are not any official representation of the company
command 2> filename Redirect any error message into a file
(command) 2> filename Redirect any CMD.exe error into a file
command > file 2>&1 Redirect output and errors to one file
command > fileA 2> fileB Redirect output and errors to separate files
command 2>&1 >filename This will fail!
Note: While I am an HPE Employee, all of my comments (whether noted or not), are my own and are not any official representation of the company
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2007 05:40 PM
тАО09-30-2007 05:40 PM
Re: cmd shell and commands
Thanks, Sheldon.
Your response did the trick.
For some reason (still unknown to me) I was finally able to capture the output by typing this:
nc -v esm9-vfpri1 515 < c:\WINDOWS\get.txt 2> fileOutX.txt
But output doesn't show any error.
These are the contents of fileOutX.txt (which is the output I get when I simply run the command w/o redirecting anything anywhere.
DNS fwd/rev mismatch: esm9-vfpri1.vf-es.internal.vodafone.com != ESM9-VFPRI1
esm9-vfpri1.vf-es.internal.vodafone.com [10.229.28.104] 515 (printer) open
How can that be?
Tnks.
Your response did the trick.
For some reason (still unknown to me) I was finally able to capture the output by typing this:
nc -v esm9-vfpri1 515 < c:\WINDOWS\get.txt 2> fileOutX.txt
But output doesn't show any error.
These are the contents of fileOutX.txt (which is the output I get when I simply run the command w/o redirecting anything anywhere.
DNS fwd/rev mismatch: esm9-vfpri1.vf-es.internal.vodafone.com != ESM9-VFPRI1
esm9-vfpri1.vf-es.internal.vodafone.com [10.229.28.104] 515 (printer) open
How can that be?
Tnks.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP