Computer Hope

Microsoft => Microsoft DOS => Topic started by: tyler77 on August 21, 2009, 03:33:19 AM

Title: exit from a dir command
Post by: tyler77 on August 21, 2009, 03:33:19 AM
Hi everybody!

how to exit after a shell command like:


dir c:\ /s 

What?

esc? or something else?

I can use only shell command. I can't close the cmd window ;)
Title: Re: exit from a dir command
Post by: squall_01 on August 21, 2009, 05:07:35 AM
I suppose this is part of a batch file, just type exit at the end will close it.
Title: Re: exit from a dir command
Post by: Carbon Dudeoxide on August 21, 2009, 05:08:48 AM
Once it finishes completing the directory for C:\, it will close.
Title: Re: exit from a dir command
Post by: WillyW on August 21, 2009, 08:40:14 AM
Hi everybody!

how to exit after a shell command like:


dir c:\ /s 

What?

esc? or something else?

I can use only shell command. I can't close the cmd window ;)



To stop it, while it is still running?

Try    Ctrl-C


Title: Re: exit from a dir command
Post by: BC_Programmer on August 21, 2009, 11:52:52 AM
or more directly, Ctrl+Break. That's what I always use.

I always thought it was the same as Ctrl-C, then I found that sometimes Ctrl-C didn't work, and Ctrl-Break did... although that was mostly with programs, not DOS commands.
Title: Re: exit from a dir command
Post by: smeezekitty on August 21, 2009, 11:57:46 AM
CTL+C is the same as CTL+BRK
you simply have to type break on
before using CTL+C
Title: Re: exit from a dir command
Post by: smeezekitty on August 21, 2009, 11:58:21 AM
forgot to add
break is always on in windows nt command prompts


[Moderated Message: Instead of posting twice in a row, please use the EDIT button next time. Thanks]
Title: Re: exit from a dir command
Post by: BC_Programmer on August 21, 2009, 12:59:30 PM
Control-C only activates when the program writes to or reads from the screen. even with Break ON it only extends to disk reads/writes. Control+Break interrupts it regardless.
Title: Re: exit from a dir command
Post by: smeezekitty on August 21, 2009, 01:01:28 PM
Control-C only activates when the program writes to or reads from the screen. even with Break ON it only extends to disk reads/writes. Control+Break interrupts it regardless.
not sure about that
because if i write a C program that does a while(1){}
loop neather CTL+BRK nor CTL+C stops it
Title: Re: exit from a dir command
Post by: squall_01 on August 21, 2009, 02:29:34 PM


To stop it, while it is still running?

Try    Ctrl-C




Isnt that a linux code or something
Title: Re: exit from a dir command
Post by: smeezekitty on August 21, 2009, 04:39:33 PM
Isnt that a linux code or something
huh?
linux is baised on unix
dos is baised on unix
Title: Re: exit from a dir command
Post by: Quantos on August 21, 2009, 04:45:11 PM
huh?
linux is baised on unix
dos is baised on unix


DOS is not based on UNIX.

Read This (http://inventors.about.com/library/weekly/aa033099.htm).
Title: Re: exit from a dir command
Post by: smeezekitty on August 21, 2009, 04:48:05 PM
but it got alot of idea from unix
such as pipes
Title: Re: exit from a dir command
Post by: Quantos on August 21, 2009, 05:00:41 PM
but it got alot of idea from unix
such as pipes


I think you need to put the pipe down.
Title: Re: exit from a dir command
Post by: squall_01 on August 22, 2009, 06:05:03 AM
dos was made before linux, gates asked for an os to be made an came up with this.   I ment isnt that something you could use in the bash shell.
Title: Re: exit from a dir command
Post by: BC_Programmer on August 22, 2009, 08:42:03 AM
DOS is based of CP/M...


UNIX is proprietary, Linux is under the GPL. I believe they are separate products. (UNIX, if I am correct, is still owned by AT&T)


To answer your question squall I'm not sure if you can use Control C, but I do know control-break is fairly universal. (I think you can use ctrl-C as well).
Title: Re: exit from a dir command
Post by: WillyW on August 22, 2009, 12:11:50 PM
...
To answer your question squall I'm not sure if you can use Control C, but I do know control-break is fairly universal. (I think you can use ctrl-C as well).

The simple thing for him to do, is ....   simply try it.   :)


dir /s                        and while all that disply is flying up the screen,    hit  Ctrl-C.

Then, he'll know.     

Title: Re: exit from a dir command
Post by: BC_Programmer on August 22, 2009, 12:13:57 PM
well... I meant, wether he could use it in the bash shell. But he could try that too (probably some form of ls)
Title: Re: exit from a dir command
Post by: squall_01 on August 22, 2009, 08:21:16 PM
not that I recall its been a while
Title: Re: exit from a dir command
Post by: Salmon Trout on August 23, 2009, 12:38:53 AM
well... I meant, wether he could use it in the bash shell. But he could try that too (probably some form of ls)

http://www.linuxforums.org/forum/linux-programming-scripting/119516-solved-difference-bw-ctrl-c-amp-ctrl-d-amp-ctrl-z.html
Title: Re: exit from a dir command
Post by: squall_01 on August 24, 2009, 04:09:02 AM
I have it wrote down some were, that looks like something that may help later.  ;)