Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool2.mu.edu!samsung!umich!sharkey!tygra!dave From: dave@tygra.ddmi.com (David Conrad) Newsgroups: comp.lang.pascal Subject: Re: Patching a process in prompt Message-ID: <1991Jan15.121656.25559@tygra.ddmi.com> Date: 15 Jan 91 12:16:56 GMT References: <25493@adm.brl.mil> Organization: Moore Software, Detroit, MI Lines: 49 Hmm. Here is one way to acheive the desired effect. A batch file: Place the following in fort.bat: BEGIN--cut here--cut here echo off :repeat fortune cmd goto repeat END--cut here--cut here And the following in cmd.pas: BEGIN--cut here--cut here program cmd; {$M 1024,0,0} uses dos; var prompt,command : string; procedure promptUser (prompt : string); begin {...Sorry, you'll have to implement this yourself...} end; begin prompt := GetEnv('PROMPT'); promptUser (prompt); readln (command); Exec (GetEnv('COMSPEC'),'/C '+command); end. END--cut here--cut here Two comments. One, you may want to call the DOS INT $21 func $a "Get Buffered Input" to provide standard editing. Two, you have to display the prompt yourself, supporting all the possible options (which gets pretty hairy). Can anyone think of a way to get DOS to display the prompt for you? If you just call COMMAND.COM with no /C command then the user would have to type `exit' after each command to get back to your shell. -- David R. Conrad dave@tygra.ddmi.com -- = CAT-TALK Conferencing Network, Computer Conferencing and File Archive = - 1-313-343-0800, 300/1200/2400/9600 baud, 8/N/1. New users use 'new' - = as a login id. AVAILABLE VIA PC-PURSUIT!!! (City code "MIDET") = E-MAIL Address: dave@DDMI.COM