Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!wuarchive!decwrl!csus.edu!ucdavis!csusac!usenet From: changw@athena.ecs.csus.edu (Weide Chang) Newsgroups: comp.os.msdos.programmer Subject: Re: Using DOS to create a logon Message-ID: <1990Oct23.051527.18526@csusac.csus.edu> Date: 23 Oct 90 05:15:27 GMT References: <1990Oct23.010706.21750@ux1.cso.uiuc.edu> Reply-To: changw@athena.ecs.csus.edu.UUCP (Weide Chang) Organization: California State University, Sacramento Lines: 33 jad43082@uxa.cso.uiuc.edu (Jason Arthur DeHaan) writes: >I have an IBM PC running MS DOS 3.2. I was wondering if there is anyone out >there that can help me solve a little problem with a batch file that I have >attempted to create. Its purpose is to record the name of the user, as well >as the time and date of signon. Using temporary files, I've managed to >sucessfully do this with one exception. When I write the time to a file, the >time command prompts the user to "Enter new time". I've hidden this and >issued a "Press RETURN to continue" command to the user, but this is both >annoying and dangerous. Is there any way to include control commands (such >as ^M) in the batch file. When I try to do this, the computer executes the >command immediately, but does not store one in the batch file. Redirection works now in DOS. So you can have a text file that contains a CR/LF and add to the time command line as: time < cr_lf.txt and the ^M will be sent to the needed time prompt as if typed in. Example: login.bat : time < cr_lf.txt ... (other commands) cr_lf.txt : (just an empty line, ^M is there) So CR/LF will be automaticly entered at the time command line and you make the login.bat bypass the time prompt. This is also helpful to erase all files from a diskette that an app- lication prompt users to put in a formatted old diskette, and call up the system's DOS to do a del a:*.* < yes.txt, where yes.txt contains only a 'y' and a ^M to satisfy the 'Are you sure (Y/N)?' prompt.