************ PS4DOS v.1.4 ************ * PS for DOS - DOS Tools * * (c) 1997 Pablo Ayllon * ************************************** INDEX: 1. Introduction. 2. Requirements. 3. Commands description. 4. What's new. 5. Copyright. 6. Disclaimer. 7. Distribution. 8. How to contact. 1.INTRODUCTION. PS4DOS v.1.4 is a set of tools designed to improve DOS command line features. This pack contains following DOS commands: BEEP v.1.3 Beeps the speaker. CDD v.1.3 Changes current drive and directory. DELAY v.1.0 Pauses for a specified length of time. DIRS v.1.1 Displays the current directory stack. DRAWBOX v.1.3 Draws a box or a window on the screen. DRAWHLN v.1.2 Draws a horizontal line on the screen. DRAWVLN v.1.2 Draws a vertical line on the screen. ECHOS v.1.1 Displays a message without carriage return and line feed. FDATE v.1.0 Changes the file date and time information. FREE v.1.3 Reports disk space status. GETLEVEL v.1.0 Reports ErrorLevel returned by last executed program. KEYBD v.1.0 Sets the state of the keyboard toggles. MEMORY v.1.0 Displays the amount and status of system RAM. POPD v.1.3 Recovers a directory from the stack and makes it default. PUSHD v.1.2 Stores current drive and directory into the stack. PWD v.2.1 Finds the full true name for a file or path. REBOOT v.1.0 Does a warm or cold system reboot. SCREEN v.1.3 Locates the cursor on the screen. SETLEVEL v.1.0 Sets the return code or ErrorLevel. STRIKE v.1.4 Stops a batch process for a lapse of time. With these commands I intend to give traditional DOS users some of the great features of cool command processors such as 4DOS or NDOS. Although not equal they behave similar with minor differences. Probably native 4DOS or NDOS commands will be faster and some options or flags may differ or may be omitted, check it out with the command-line help. Commands support DOS redirections such as > or >> for sending output information to a file or printer or similar. Also country support has been added, this means that programs automatically detect your country settings to report output information in the correct format, for instance, using the correct thousands separator for each country. 2.REQUIREMENTS. Any 80x86 processor or compatible. MSDOS 3.x or higher is suggested except for FREE that needs at least MSDOS 4.x. All comands have been widely tested on systems running MSDOS 6.x and MSDOS 7.0 sucessfully. I don't know if any incompatibility will appear under other compatibles DOSes or in certain machines. I have performed all tests I was able to do but I cannot be certain that they are bug free. 3.DESCRIPTION. All commands accepts /? or /h for command-line help. Values between brackets [] are optional. Arguments are no case sensitive. 3.1 BEEP. Beeps the internal PC speaker. If during the beeps the user presses any key the program stops and reports and ERRORLEVEL equal to one (1), otherwise the ERRORLEVEL should be zero (0). Command line options: [/Fnn] Beeps a tone of nn hertz of frequency. [/Lnn] Length of beep in nn/18 second intervals. [/Tnn] Repites the beep nn times. [/Wnn] Waits nn/18 second intervals between beeps. Frequency can be in a range of 1-20000 hz. The beep can be repeated no more than 600 times, while the length of the beep and the pause between beeps can be a maximun of 1080/18 second intervals, this is, 60 seconds. Use a non audible beep of 1 hertz to insert a short delay in a batch process. Default frequency is 440 hz for an only beep of 1/18 seconds. Example: BEEP /F800 /L9 /T3 /W5 3.2 CDD. Changes current drive and directory. This command behaves like CD standard DOS command but it can change the working drive as well. Also you can make use of a CDPATH environment variable the same way you use the PATH enviroment variable. CDPATH cannot be longer than 253 characters. Example: SET CDPATH=c:\;c:\programs;c:\windows If under PROGRAMS directory there is another directory called AUDIO, you can type wherever you are CDD AUDIO to go there. Search priority in CDPATH is equal as in PATH, the first to find, the first to go. Command line options: [pathname] The name of the new default drive and directory. Example: CDD A:\WORK 3.3 DELAY. Pauses for a specified length of time. If the count reaches end time the command reports and ERRORLEVEL equal to zero (0), while if the user presses a key while counting it returns an ERRORLEVEL equal to one (1). Command line options: [seconds] The number of seconds to delay. Maximun time to wait is 2,147,483,647 seconds, this is, more than twenty four thousands days! Surely this is not useful but that's the upper limit, while minimun time is 0 seconds that means no pause. Minimun increment of time is 1 second. If not time is specified the program will pause for one second. Use a value of -1 for an endless waiting. Refer to BEEP (3.1) above in this document for pauses shorter than one second. Example: PAUSE 5 3.4 DIRS. Displays the current directory lifo stack (Last In First Out) where PUSHD command stores the pathnames that will be used by POPD to return to previous directories. Uppest value in directory stack is last entry, lowest value is first entry. Command line options: (none). DIRS returns an errorlevel equal to one (1) if there was any problem with the stack file PUSHD.DAT Refer to POPD (3.14) and PUSHD (3.15) below in this document for further information. Example: DIRS 3.5 DRAWBOX. Draws a box or a window on the screen. The difference between a box and a window is that a box only draws the borders while a window erases the contents inside the box. Command line options: ulrop Row for upper left corner. ulcol Column for upper left corner. lrrow Row for lower rigth corner. lrcol Column for lower right corner. [/B] Draws a bold box. [/D] Draws a double line style box. [/W] Draws a window instead of a box. Corners values must be between ulrop=1, ulcol=1 for upper left corner and lrrow=25, lrcol=80 for lower right corner. Example: DRAWBOX 5 10 15 45 /B /D 3.6 DRAWHLN. Draws a horizontal line on the screen. Command line options: row Starting row. column Starting column. length Length of line. [/B] Draws a bold line. [/D] Draws a double style line. Starting row must between 1 and 25, starting column must be between 1 and 80 and, of course, length must be at least 1 but length plus starting column cannnot be higher than 80. Example: DRAWHLN 10 15 20 /B /D 3.7 DRAWVLN. Draws a vertical line on the screen. Command line options: row Starting row. column Starting column. length Length of line. [/B] Draws a bold line. [/D] Draws a double style line. Starting row must between 1 and 25, starting column must be between 1 and 80 and, of course, length must be at least 1 but length plus starting row cannot be higher than 25. Example: DRAWHLN 5 50 15 /B /D 3.8 ECHOS. Displays a message without carriage return and line feed. This is useful for output text when you don't want to add a carriage return / linefeed pair at the end of the line. Command line options: [message] Message to display. ECHOS handles the message to display as a stream, not as single parameters, this way, spaces between words are kept. Any character can be put into the message, even escape codes and special characters such as BEL (ASCII 7) and others. Some special characters such as |, > or >> cannot be displayed as they are standard DOS redirection characters. Example: ECHOS This is a message > LPT1 ECHOS  3.9 FDATE. Changes the file date and time information. Command line options: pathname The name of the file(s) to change date and time. [/D[date]] Sets the date to month-day-year. [/T[time]] Sets the time to hour:minute:second. [/P] Pauses after each screen. Date's format is country dependent, therefore, if you live in USA it should be mm-dd-yy[yy], while if you live in Europe it goes dd-mm-yy[yy] and yy[yy]-mm-dd for Japan, Canada, etc., but input values must be always separated by a dash '-'. The range of possible years is 1980-2099, and can be specified with two or four ciphers if lower than 2000 and by four ciphers if equal or greater than 2000. Normal rules for months and days. Time's format goes hh:mm:ss always using 24 hour format. Input values must be separate by a two points character ':'. As an additional option you can omit minutes or seconds, these omitted values will be filled with 00. Use /D and /T without specifying any particular date and time to set files to current date and time. For a pianless use two arguments must be specified at least. One is 'pathname', this avoid changing file's date and time by simply typing the name of the command without arguments, so, unless you type a path or a file's name nothing will happen. Second is, at least, a /D or a /T switch, this avoid unwanted changing of file's date and time unless you clearly specify so. This means that no default decisions will be taken but what you type in the command line. To construct the pathname, relatives paths can be used following the same rules as DOS command DIR. Example: FDATE *.jpg /D10-10-97 /T /P FDATE c:\temp\docu1.doc /T20:14:37 FDATE . /D12-8-2004 /T13 No recursive subdirectories is implemented yet. Also, you cannot change the date and time of a subdirectory. 3.10 FREE. Reports disk space status. This command reports the same information as DOS command CHKDSK but without the wait since it does not check disk structure and integrity. Multiples disk drives can be especified at one time. Command line options: [drive(s)] One or more drives to include in the report. FREE cannot be used on network or soft mounted drives. You can have troubles trying to run FREE on CDROM drives, it seems to work right under Windows 95 but not under MSCDEX because they are treated as network drives. FREE also displays the FAT type of the drive. Possible values are FAT12, FAT16, CDROM (for High Sierra CD-ROM), CD001 (for ISO 9660 CD-ROM) and CDAUDIO. Example: FREE C: D: 3.11 GETLEVEL. Reports ErrorLevel returned by last executed program. Many programs return an errorlevel to command interpreters indicating malfunctions, abnormal program termination or any other kind of return code defined by the programmers than users can find useful to test to take decisions, for example, in batch files. GETLEVEL gets this return code or ERRORLEVEL and displays it. Command line options: (none). Every time GETLEVEL gets the return code of a previous executed program, the errorlevel is cleared, so the return code can only be sucessfully retrieved once. Example: GETLEVEL 3.12 KEYBD. Sets the state of the keyboard toggles: Caps Lock, Num Lock and Scroll Lock. Most Keyboards have these 3 toggle keys. The toggle status is usually displayed by three lights at the top rigth corner of the keyboard. KEYBD lets you toggle these keys on or off. Command line options: [/Cn] Toggles Caps Lock. [/Nn] Toggles Num Lock. [/Sn] Toggles Scroll Lock. The parameter 'n' can be either 0 to turn off the toggle or 1 to turn on the toggle. If no switches are used KEYBD displays the status of the toggle keys. Example: KEYBD /C1 /N0 3.13 MEMORY. Displays the amount and status of system RAM. MEMORY's output depends on what kind of memory you have installed and configured in your system. Also displays the HMA status and what version of XMS and EMS drivers are being used if present. Command line options: (none). There might be a slight difference between free base memory reported by MEMORY and other memory map programs. Example: MEMORY 3.14 POPD. Recovers a directory from the stack and makes it default. PUSHD creates a directory stack where it stores pathnames in a file named PUSHD.DAT, these pathnames will be read by POPD and then it will change the current drive and directory. Command line options: [*] Clears the directory stack. Whenever you want to clean the directory stack use POPD with * flag, otherwise use POPD alone to change current drive and directory to last entry (uppest) in PUSHD.DAT POPD returns an errorlevel equal to one (1) if there was any problem with the stack file PUSHD.DAT Refer to DIRS (3.4) above and PUSHD (3.15) below in this document for further information. Example: POPD * 3.15 PUSHD. Stores current drive and directory into the stack. This way it is extremily easy to return to a directory by simply typing POPD after several commands. PUSHD, POPD and DIRS make use of a file named PUSHD.DAT where the directory stack is stored, the location of this file can be set with a PUSHD environment variable. Example: SET PUSHD=C:\TEMP Otherwise, if no SET PUSHD sentence is typed, this three programs will used the directory from where they are executed to write and read PUSHD.DAT, so keep in mind to place them in the same directory if you don't want unpredictible behaviour. The file PUSHD.DAT will be created by PUSHD if it doesn't exist. Command line options: [pathname] The name of the new default drive and directory. Optionally PUSHD can change the current drive and directory prior to store pathnames in the stack file, this way you can save a CD or CDD instruction. PUSHD returns an errorlevel equal to one (1) if there was any problem with the stack file PUSHD.DAT Refer to DIRS (3.4) and POPD (3.14) above in this document for further information. Example: PUSHD d:\document Follow next complete example to see how works the directory stack: Let's start supossing you are in TEMP dir. C:\TEMP>POPD * (To clean the directory stack, this is optional) C:\TEMP>PUSHD C:\PROGRAMS C:\PROGRAMS>DIRS c:\temp C:\PROGRAMS>PUSHD D:\TEMP\WORK D:\TEMP\WORK>DIRS c:\programs c:\temp D:\TEMP\WORK>PUSHD } A command can be saved by typing } PUSHD A:\WORK\TEXT D:\TEMP\WORK>CDD A:\DOCS } instead of these two commands A:\DOCS>DIRS d:\temp\work c:\programs c:\temp A:\DOCS>POPD D:\TEMP\WORK>POPD C:\PROGRAMS>DIRS c:\temp C:\PROGRAMS>POPD C:\TEMP> (directory stack is empty) 3.16 PWD. Finds the full true name for a file or path. This command behaves equal to MSDOS TRUENAME undocumented command as well as 4DOS or NDOS TRUENAME command. Default directories and ASSIGNed, JOINed and SUBSTituted paths can obscure the true name of a file or path. Use PWD to get the canonical name of a filename or path. Command line options: [pathname] The file or path to report truename. If no argument is used PWD reports the truename of the current path. Example: C:\>SUBST H: C:\TEMP C:\>PWD H:\ Output will be 'C:\TEMP' 3.17 REBOOT. Does a warm or cold system reboot. REBOOT restarts the computer, normally performing a warm reboot which is comparable to pressing . It can also perform a cold reboot which is similar to pressing the reset button or turning the power off and back on but not equal as REBOOT cannot reset all hardware devices while by making a "hard" reboot you turn off and back on the power reseting all the hardware. REBOOT closes files and flushes disk buffers, resets disk drives and, also, flushes disk caching programs, including QuickCache, PC-Kwik, PC-Cache, NCache and SmartDrv. Then performs a one second delay to allow these caching programs to finish writing cached data. REBOOT resets the computer via the CMOS. Somes BIOSes, memory managers, or TSRs may interfere converting a cold reboot request to a warm reboot or, even, hanging the system. Be carefull using REBOOT without prior testing, you should experiment with it. Command line options: /C Does a cold reboot. /V Prompts for confirmation before rebooting. By default REBOOT will perform a warm reboot with no prompting. Example: REBOOT /C /V 3.18 SCREEN. Locates the cursor on the screen. Command line options: row Row location for the cursor. column Column location for the cursor. [text] Text to display at the new cursor location. [/B] Displays bold text. Row must be between 1 and 25 while columm must be between 1 and 80. Example: SCREEN 10 40 /B Hi World! 3.19 SETLEVEL. Sets the return code or ErrorLevel. SETLEVEL forces the value of the environment variable ERRORLEVEL. This can be useful to reports different return codes when terminating a batch file, even to test batch files that behave different depending on errorlevels reported by several programs. Command line options: n The return code to set. The parameter 'n' must be between 0 and 255. Example: SETLEVEL 6 3.20 STRIKE. Stops a batch process for a lapse of time. If the count reaches end time the command reports and ERRORLEVEL equal to zero (0), while if the user presses a key while counting it returns an ERRORLEVEL equal to one (1). Command line options: [text] Text to display. [/B] Displays bold text. [/Lnn] Waits nn seconds to continue with batch process if no key is pressed. [/Rnn] Row location for the text to display. [/Cnn] Column location for the text to display. Row values can be from 1 to 25 and column values from 1 to 80. Maximun time to wait is 60 seconds, especify no time value for an unlimited waiting. Example: STRIKE Please press a key to continue /B /L15 /R5 /C10 4.WHAT'S NEW. There are eigth new comands: DELAY, ECHOS, FDATE, GETLEVEL, KEYBD, MEMORY, REBOOT and SETLEVEL. General new features: - Now all commands support DOS redirections such as > and >>. - Added country support to report information on screen depending on your COUNTRY settings in your CONFIG.SYS (suggestion made by Yves Bellefeuille) New features: FREE: Supports country settings to display output. Can report information on CDROM drives. Detects network drives. Supports partitions bigger than 2Gb. PWD: Completely rewritten. Supports DOS TrueName features. Bugs fixed: FREE: Fixed a bug when accessing CDROM drives. POPD: Fixed a bug reporting bad errorlevel when normal program termination. CDD : Fixed a bug concerning CDPATH and input paths parameters. Fixed a bug reporting bad errorlevel when normal program termination. BEEP & STRIKE : Delay routine used by this programs have been highly improved, now it is more accurate. Other minor fixes has been done here and there. 5.COPYRIGHT. All tools included in this package (Beep, Cdd, Delay, Dirs, Drawbox, Drawhln, Drawvln, Echos, Fdate, Free, Getlevel, Keybd, Memory, Popd, Pushd, Pwd, Reboot, Screen, Setlevel and Strike) are programs written by the author. The propierty of these programs belong to the author. No modifications are allowed. Mention of other products are only for informational purposes. MSDOS is a registered trademark of Microsoft Corp. 4DOS is published by JP Software Inc. NDOS is a registered trademark of Symantec Corp. distributed under license of JP Software Inc. 6.DISCLAIMER. The author of this software DOES NOT ACCEPT ANY RESPONSIBILITIES for damages resulting from the use of the program and make NO WARRANTY or representation, either express or implied, including but not limited to, any implied warranty of merchantability of fitness for a particular purpose. The software and related documentation are provided "AS IS" and the users assume all risks when using it. 7.DISTRIBUTION. PS4DOS v.1.4 with all the tools included (Beep, Cdd, Delay, Dirs, Drawbox, Drawhln, Drawvln, Echos, Fdate, Free, GetLevel, Keybd, Memory, Popd, Pushd, Pwd, Reboot, Screen, SetLevel and Strike) is FREEWARE. PS4DOS v.1.4 may be freely distribute, so long no modifications are made and no money is ever charged for the package or it's components. It can be uploaded to BBS, FTP or WWW sites, Usenet newsgroups, or distribute in CD-ROM disks, diskettes or any other media provided you distribute them in their original form with all files intact and give the author credit. Please, distribute only the full package. 8.HOW TO CONTACT. If you like these programs or have any suggestion or comment, please let me know by sending me an e-mail or a netmail to: ayllonp@mundivia.es netmail 2:344/31.14 Pablo Ayllon, March, 1997 Member of ACCE (Cantabrian Electronic Mail Association) Homepage http://personales.mundivia.es/personales/ayllonp/ Made in Spain. A splendid time is guaranteed for all.