1.

Solve : Re=director ( > ) not working for what I need...?

Answer»

Hey EVERYONE,

I've used this site for a long time and now I finally have a question that hasn't already been addressed!

If you TYPE in this:

net use \\mypc /user:fake 1234 > test.txt

and the username/password are WRONG, then windows says:

System Error 1326 has occurred.
Logon Failure: Unknown user name or bad password

If you type test.txt there are no contents...is there any way of catching the error in a text document? Is there any other way I can identify the error if this cannot be copied to a document? THANKS for the help ahead of time.Most of the Microsoft utilities are pretty standard concerning output streams. This may be what you're looking for:

Code: [Select]net use \\mypc /user:fake 1234 2> test.txt

Good luck. Wow, that just saved me a WHOLE lot of hassle. I kneel before thee in honor, knower of dos :-POut of curiosity....what is the definition of 2>? Where did you find out about it?There are multiple output streams created by most of the Microsoft utilities.

STDIN is data stream 0
STDOUT is data stream 1
STDERR is data stream 2

There are others but these are the most widely used for redirection.

Quote

Where did you find out about it?
I thought everybody knew these things.

Actually it's documented in most DOS books in the fine print. On the internet check out Allenware. Scroll down and click the link to Batch Reference on the left SIDE of the page, and in the course reference window (upper right), you will find stdin, stdout, stderr along with pretty much anything ELSE you might need to know.

Good luck.


Discussion

No Comment Found