Home / Microsoft / Microsoft DOS / [SOLVED] redirecting output
0 Members and 3 Guests are viewing this topic. « previous next »
Pages: 1 [2]  All - (Bottom) Print
Author Topic: [SOLVED] redirecting output  (Read 1658 times)
Two-eyes
Topic Starter
Intermediate



Thanked: 4
Posts: 166




« Reply #15 on: September 12, 2009, 07:21:34 AM »

oh, that's nice
Thanks :)
...
What do you know?  I tried the first code you sent, and it worked(obviously).
Then I tried this:
Code: [Select]
(ECHO hiya >doesnotexist\notextfile.txt) 2>error.txt
and got a text file called error.txt saying "the path couldnt be found" (ie the output i wanted originally)

dang...now I am even more curious ;D

Thanks :)
IP logged

Quote
I believe the bushes in my yard will BURN before God picks up a PC to send a message

Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #16 on: September 12, 2009, 07:50:52 AM »

See my (edited) post No. 12 above.
IP logged


Proud to be European
Two-eyes
Topic Starter
Intermediate



Thanked: 4
Posts: 166




« Reply #17 on: September 12, 2009, 07:58:47 AM »

ooops  :-[
Sorry, but you edited it twice, so I thought you meant the first edit.....my bad

Thanks

Two-Eyes
IP logged

Quote
I believe the bushes in my yard will BURN before God picks up a PC to send a message

Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #18 on: September 12, 2009, 08:06:49 AM »

ooops  :-[
Sorry, but you edited it twice, so I thought you meant the first edit.....my bad

Thanks

Two-Eyes

No, my bad, I forgot I had edited it twice (I can't remember what I wrote first!)
IP logged


Proud to be European
Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #19 on: September 12, 2009, 08:29:23 AM »

I think the answer is, that you know where the echo command ends but cmd.exe does not

ECHO hiya >doesnotexist\notextfile.txt 2>error.txt

it thinks this is the filename to echo hiya into:

doesnotexist\notextfile.txt 2>error.txt

But this way it knows

(ECHO hiya >doesnotexist\notextfile.txt) 2>error.txt



IP logged


Proud to be European
Two-eyes
Topic Starter
Intermediate



Thanked: 4
Posts: 166




« Reply #20 on: September 12, 2009, 11:53:33 AM »

ahhh yes.  The assumption "what I know, it knows".  I fall quite a few times in that. :)
IP logged

Quote
I believe the bushes in my yard will BURN before God picks up a PC to send a message

Pages: 1 [2]  All - (Top) Print 
Home / Microsoft / Microsoft DOS / [SOLVED] redirecting output « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.091 seconds with 19 queries.