Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!csus.edu!nic.csu.net!csun!csunb.csun.edu!abcscnuk From: abcscnuk@csunb.csun.edu (Naoto Kimura (ACM)) Newsgroups: comp.lang.pascal Subject: Re: DOS command line Keywords: command line Message-ID: <1991Mar20.115312.25660@csun.edu> Date: 20 Mar 91 11:53:12 GMT References: <1991Mar19.161155.21637@en.ecn.purdue.edu> <5694@gara.une.oz.au> Sender: news@csun.edu (News Administrator) Organization: csun Lines: 57 In article <5694@gara.une.oz.au> ddavidso@gara.UUCP (Dean Davidson) writes: ]In article <1991Mar19.161155.21637@en.ecn.purdue.edu> terran@en.ecn.purdue.edu (The Lord of Fire and Death) writes: ]>Does anybody know where the DOS command line is kept in memory and/or ]>how to find it at run time? ] ]The following should do the job for you: ] ]-------------------------------------------------------------------- ] ]{function to get the command line} ]{modified by Dean Davidson from an idea by Trevor Carlson} ] ]type ]st = string[128]; ]pt = ^st; ] ]function cl : st; ]{function to get the command line} ] ]var ]sp : pt; ] ]begin ] sp := ptr(PrefixSeg,$80); ] cl := sp^; ]end; One caution with this program... This only gives the command tail of the current process (the program accessing the command line that invoked it). The original poster was intending to write a TSR that stored command lines (possibly to be able to recall them later -- much like CED). I would suggest getting the book "Undocumented DOS" -- there is a chapter on command processors which might be of use. I haven't gotten around to reading that particular chapter yet, so I can't be sure if it gives the info the original poster wants, but it should be a start. For those who are interested in writing TSR's, it's a must-have ! ******************************************************************* * * * title: Undocumented DOS * * authors: Andrew Schulman, Raymond J. Michels, Jim Kyle, * * Tim Paterson, David Maxey, and Ralf Brown * * publisher: Addison-Wesley Publishing Company * * cover price: $39.95 * * disks w/ software included. * * hypertext document of v.4.90 of the Interrupt * * list! * * * ******************************************************************* //-n-\\ Naoto Kimura _____---=======---_____ (abcscnuk@csuna.csun.edu) ====____\ /.. ..\ /____==== // ---\__O__/--- \\ Enterprise... Surrender or we'll \_\ /_/ send back your *&^$% tribbles !!