Article View: comp.os.msdos.misc
Article #3515Re: How to put CARRIAGE RETURN in Batch file
From: Doug Parsons
Date: Wed, 26 Jun 1991 00:43
Date: Wed, 26 Jun 1991 00:43
32 lines
1561 bytes
1561 bytes
I haven't tested this, but.. Create a file thus: C:> COPY CON CR. <-- copy from the console (kbd) to file called 'CR'. <-- hit Enter here, which puts a <CR> character in file Control-Z <-- Press Control-Z here, to terminate input (1) file copied. C:> What you have done is created a 2 character file consisting of a CR and a control-Z (end of file marker). Now you just have to use this as stdin (standard input, which is normally the keyboard) when you want a carriage return: myprog.exe < CR <-pretend MYPROG normally asks for a CR before continuing. Note that this doesn't work with PAUSE (well, it didn't work for me, anyway). I hope that won't be a problem as the solution for PAUSE is to remove it! BTW, I use this technique to get around the "Are you sure? (Y/N) :" when you try to do a DEL *.*. I have a file that contains a Y<CR>Control-Z, and do this: DEL *.* <Y <-- The file is named "Y." which works a treat in an autoexec.bat file when you want to clear all the temp files left over from an aborted Windows/3 session! ie. DEL C:\windows\temp\*.* <Y douginoz
Technical Details
Message-ID:
<3060001@hparc0.HP.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!sdd.hp.com!hplabs!hpcc05!hparc0!dougReferences:
<7130@disc.dla.mil>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!sdd.hp.com!hplabs!hpcc05!hparc0!doug From: doug@hparc0.HP.COM (Doug Parsons) Newsgroups: comp.os.msdos.misc Subject: Re: How to put CARRIAGE RETURN in Batch file Message-ID: <3060001@hparc0.HP.COM> Date: 26 Jun 91 00:43:15 GMT References: <7130@disc.dla.mil> Organization: HP Australasian Response Centre (Melbourne) Lines: 32