![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-04 09:07 |
48,038 topics / 350,123 posts / today 0 new / 48,251 members |
| DOS学习入门 & 精彩文章 (教学室) » Repost: "Manual for 4DOS 2" |
| Printable Version 4,113 / 2 |
| Floor1 Lydong | Posted 2002-10-22 00:00 |
| 元老会员 Posts 407 Credits 1,468 From 广州 | |
|
1. Different colors can be set for each extension when using DIR. For example:
> set colordir=com exe bat btm:white;dirs:bri yellow 2. It is convenient to switch subdirectories. For example: > c:\et\ and then press can switch to it. Of course, it is more convenient if combined with. 3. History is enhanced. Press or to display a History window for you to select the commands you have typed. 4. It is less likely to freeze under DesqView. 5. Prompt can be designed more powerfully. For example: prompt $z$s$p$g displays which level of Shell you are in. 6. Directly set HotKeys under DOS without going through ANSI.SYS. For example: > alias @shift-f10 eexitr Then pressing Shift-F10 directly returns to the previous level of Shell > alias @f12 clsr Then pressing directly clears the screen, Oh ~~ Nice!! 7. Some initial value settings can be placed in 4DOS.INI. 8. Swapping methods are diversified. For example, set in 4dos.ini: Swapping =,XMS,EMS,F:\TMP,C:\TMP,NONE Then swap to XMS, and when XMS is full, use EMS... (XMS is faster than EMS under qemm386!!) 9. Filename wildcard is enhanced. this can be used to represent athis or bthis or cthis. For detailed situations, please refer to the DOC by yourself! 10. It is convenient to switch between two subdirectories. For example: C:\> c:\bin\ switches to c:\bin C:\BIN> d:\test\ switches to d:\test C:\TEST> cd - C:\TEST> Have you found its convenience?! 11. Powerful key functions of keystack: When executing a certain program, a certain key value can be passed to the program, just like you pressing a certain key. For example, there is an anti-virus program Vr_dt. The non-registered version of the program will remind you to pay when executed, and then wait for you to press any key to continue execution. At this time, you first execute a resident program kstack.com (providing keystack function), and then execute: keystack enter ^ vr_dt/i At this time, keystack will pass the enter key value to vr_dt.com, just like you executing vr_dt/i and then pressing the enter key!! 4DOS is Shareware used with MS/PC DOS (hereinafter referred to as DOS). Have you often felt that the user interface (User Interface) has poor affinity and some functions are not ideal enough during the years you have used DOS? In the United States, a user wrote to Microsoft Corporation after using 4DOS, suggesting that the new version of DOS could be based on 4DOS. I personally feel that this is true after using it, so I write this article to provide you with an advanced door and share the convenience of my current working environment with you. 4DOS does not occupy memory. This sounds quite mysterious, but it is indeed the case. When it is executed, it will release itself from memory. Usually, you can swap it to HMA (High Memory Area, that is, the first 64KB area above 1024KB), or swap it to EMS, or swap it to Disk in the form of a file, which does not affect the already meager 640KB at all. And the compatibility is very high. As long as it is a DOS-compatible system, it is okay. It is compatible with networks such as 3Com 3+, Novell Netware, Chinese systems such as ETen, KC, 01, memory management programs such as QEMM, and even Windows 3.0. 4DOS can directly make the Speaker sound, can record the commands that someone who擅自 uses your computer has issued without your permission, can store Batch File in RAM so that you don't need to set a lot of Batch File to waste hard disk space, has the function of setting the pause time and then continuing, has the function of annotating directories for you, has the function of recording all the commands you have issued, has..... There are really too many easy-to-use functions.... Please don't get too excited, wipe your saliva, and the following is the explanation. The first step, you must unzip 4DOS301a.ZIP, put 4DOS.COM, 4DOS286.EXE in the ROOT, and set in CONFIG.SYS: SHELL=C:\4DOS.COM /P /E:1024 /A:1024 /H:1024 │ │ │ └─ History : space for the commands you have issued │ │ └─ Alias : space for the command set functions you have set │ └─ Environment : working space └─ Without this parameter, AUTOEXEC.BAT will not be executed when booting SET COMSPEC=C:\4DOS.COM Since the original explanation file is too large (one 2D), only the special points are listed here. ======================================================== 1. Do you have a subdirectory specially for placing Batch File? A Batch File that is only a few bytes also occupies 2048 bytes of hard disk space. What if there are more? But it is indispensable. What to do?? ALIAS can store the command set you have set in memory, does not occupy 640K memory, does not occupy hard disk space, is executed at RAM speed, is fast and does not need to read the hard disk. 2. Has someone擅自 used your computer and you don't know it, but you inexplicably get a virus, or important programs are pirated or damaged, or settings are changed? LOG can write all the commands you have executed with the time attached to a file. You can usually turn it off, turn it on when you leave, and then you will know when someone has used your computer and what commands they have issued. 3. Often issue very long commands that need to be repeated all the time, write them into Batch File and there are often changes in variables, and running some resident programs also wastes memory space. 4DOS has this function built-in, and you can call out the commands you have issued at any time, edit them and then execute them. 4. Do you have many directories or files on your hard disk that you forget what they are after a long time without use? DESCRIBE can add a short description of 40 words next to the directory or file name you specify, as follows: 5DOS 11-17-90 17:56 Microsoft DOS 5.0 NEWS Version ET 12-25-90 23:34 ETen Chinese system. autoexec.bat 314 1-15-91 0:07 Run when boot finished 5. You want to repeatedly read the content of a file, and TYPE flashes by once and then disappears. Using software like PE2 to read seems too formal (needing to wait for hard disk reading and occupying memory). LIST is a fast and simple built-in function. 6. Do you want the computer to make a series of beeps to remind you that a certain work has been completed or to warn you of some messages? BEEP can make you make sounds with different sound pitches and combinations. 7. There are many commands in DOS that do not have On-Line Help functions. Sometimes you have to turn the book over, and some work can't stand such interruption. F1 has a complete On-Line Help function, teaching you the parameters, as well as examples and the timing of use. 8. Is it really impossible to handle ambiguous file names or multiple files in DOS? DIR DIR *2*.B* DEL DEL *.BAK TEST.TXT 4DOS.DOC COPY COPY *.DOC GOD.C *.TXT A: CDD C:\>CDD D:\ET immediately change the current Driver and Path The above is only a part. The strongest point is that all functions are built-in commands. Except that the description part of On-Line Help is too large and needs to be placed separately, you don't need to set up a set of 4DOS in another space at all. There are only two files 4DOS.COM and 4DOS286.EXE (XT needs to use 4DOS88.EXE) in the ROOT. However, the only shortcoming is that you cannot add /S when FORMAT, otherwise the written COMMAND.COM is 4DOS.COM instead of the normal DOS COMMAND.COM. In short, 4DOS will save you a lot of hard disk space, reading time, be more humanized, and have higher affinity. It has corrected and enhanced many small places in DOS that you think are not perfect enough, and the functions are increased. The working environment it sets for you will make you...... Hey!? Why am I also drooling? This software is extremely unpopular in China. Please find more BBS stations. More scale or the stations I often go to should all have it. If you really can't find it, please leave a letter on any letter network, and I will tell you or D/L it to you. The file is not large. 4DOS301a.ZIP is only one 2D. If you have already got it and are using it, users are also welcome to write to discuss. ================================================================================ First of all, let's confirm the compatibility of 4DOS: In terms of hardware: PC, PC XT, PC AT/386, PS/2 and Compatible models are all completely compatible. In terms of system: PC-DOS, MS-DOS, Chinese system are all compatible. In terms of network: MS-DOS Compatible networks including 3Com 3+, Novell Netware are all compatible. In terms of software: Lotus, dBase, DESQview, QEMM, Windows.... etc. are all compatible. Since the compatibility is no problem, what about the use environment? 4DOS is said to be the first software to support XMS. Although Intel has set the XMS specification in '88, so far, 4DOS is the first published software to support XMS. When 4DOS is loaded at boot time, it will first find HMA (High Memory Area), then find EMS. If neither is found, it will automatically swap on the disk. In terms of memory, it has reached the automatic search for the most economical way to be resident. All functions and commands are built-in. To be honest, even if you remove COMMAND.COM in the boot system and change 4DOS.COM to COMMAND.COM, it is okay. Then can we use it directly? BIN-BON! You are right. If you have such low requirements for your system, you can indeed use it like this. But since 4DOS is so powerful, of course it will let the User set some parameters to make it more flexible. The following is the explanation. Uppercase means the parts that cannot be changed, and lowercase means as the User likes (but not too much): First of all, you need to add SHELL = d:\path\4DOS.COM in CONFIG.SYS, so that the computer will not look for COMMAND.COM when booting, but directly use 4DOS.COM as COMMAND.COM. Parameters: /A:n The size of ALIAS. ALIAS is equal to the BATCH file of DOS. When executed, it is the first item to be executed. All are loaded into Memory first and then executed. The default value is 1024 (bytes, the following are all). If you set a lot of ALIAS, n should also be increased. The exceeded ALIAS will not be loaded. n is between 256 - 32000. /E The size of the environment. n is between 256 - 32000. There are the following two usages: /E:n Directly set the size. The default value is 512. /E+n If the environment is insufficient for use, you can additionally append the secondary environment for use. The default value is 128, and n must be in units of 128, such as 256, 512, 1024.. /H:n The size of the command editing space. 4DOS can call out and edit the commands you have issued. The larger the space, the more you remember. The default value is 1024. n is between 512 - 8192. The latest command will squeeze out the oldest one. You can query with the up and down keys or F3 to repeat the previous command after the current cursor position. After calling out, you can Insert or Delete to edit. /U Swap 4DOS to UMB (Upper Memory Block). If you use memory management programs such as QEMM, adding this parameter ensures no conflict, because 4DOS swaps by itself instead of relying on the management program to swap. /P 4DOS proceeds according to the default SWAP method, and all variables are set with default values if not specified. Example: SHELL=C:\4DOS.COM /A:1024 /E:1024U /H:1024 /P /U Also: Because it is not a book, time and space are limited, so the parameters are not all introduced. Only the commonly used variables are included. Secondly, add SET COMSPEC=d:\path\4DOS.COM in AUTOEXEC.BAT, which is better. When setting PATH, it is best to set C:\ first; and remember to include the path where 4ODS's HELP.EXE and DOS.HLP are located, and give priority to the path of DOS 5.0, otherwise when pressing F1, what appears is not the HELP of 4DOS but the HELP of DOS 5.0. Speaking of HELP, the HELP function of 4DOS is quite good. Users who have read 4DOS.DOC may use F1 to see the functions of 4DOS more clearly. ================================================================================ 4DOS Extended Batch File Skills Collection 1. Often we all judge whether the value passed in by the USER in the batch file is an empty string. The most common way of writing is probably IF '%1'=='' GOTO HELP It means that if it is an empty string, jump to the HELP section to continue executing the batch file But 4DOS provides another way of writing. Refer to the following IF %@LEN=0 GOTO HELP How about, it is very similar to the writing of BASIC! PS. %@ is a built-in character of 4DOS, and the following will not be described separately. 2. Also introduce you a character EXT When we use the batch file, MS-DOS can only handle the entire file name and cannot handle only the extension name. When I was dealing with station affairs, I often needed to make different time backups of the USER file of SUPER BBS. For example. COPY USERS.BBS 01-01-92.BBS Since the date cannot be captured in the batch file, the extension name cannot be processed accordingly. I have to find a small tool to use. But I still feel not very smooth. Later, after changing to 4DOS, I changed it to use the following writing. COPY %1 %_DATE.%@EXT %1 should not need to be explained. It is the parameter passed in the batch file. %_DATE means the date. %@EXT means to capture the extension name of %1. How!. Not bad, right. ;> For example, I wrote a batch file called SHOW IF %@EXT==GIF GOTO CSHOW IF %@EXT==ARJ GOTO ARJ_L IF %@EXT==ZIP GOTO PKZ_V IF %@EXT==LZH GOTO LHA_L IF %@EXT==VL GOTO APPLY How about. SHEZ is not necessarily better than me... 3. I often encounter many situations. When I need to clear a directory. But a few specific files need to be left. The most common way of use. is to copy the files to be left to other places, then clear the entire directory and then move the files back. Now there is no need to bother. 4DOS provides this function EXCEPT (*.DOC) DEL *.* /Y Then in the current directory, all.DOC files will be retained, and the others will be deleted Of course, the files can also contain more than one. You can use the following writing EXCEPT (*.DOC *.TXT) DEL *.* /Y Smart you. If you want to use it in the batch file. It is very simple. Just replace the file name with %1. RIGHT?? ;> 4. Many people often complain that DOS cannot perform mathematical operations. You have to find some small tools to use. or write a small program by yourself. Now you don't need to. The batch file can. 4DOS provides a built-in character - EVAL. So how to use it?? Very simple. You just type on 4DOS ECHO %@EVAL Then you will immediately see on the screen that 99 multiplied by 99 equals 9801. But.... This is still not very easy to use. Then what should be done?? Write a batch file. ECHO %1 = %@EVAL Ha! Then those small tools can all be thrown away... ;> 5. Many when writing batch files. Always like their programs to make sounds. It is best to sing a song. That is naturally the most perfect thing. Hey. Secretly tell you BEEP can. How... 4DOS is not bad. Secretly give you the songs written by others for reference. Have a research by yourself when you have time. beep 392 8 524 8 392 8 262 8 392 8 524 8 392 8 19 8 beep 392 8 524 8 392 8 524 8 659 4 19 8 beep 587 3 524 3 494 3 440 3 415 3 beep 392 8 524 8 392 8 262 8 392 8 524 8 392 8 19 8 beep 524 4 19 8 440 3 392 3 19 4 349 3 19 4 beep 330 3 19 4 294 3 19 4 262 3 19 12 beep 233 8 311 8 233 8 156 8 233 8 311 8 233 8 19 8 beep 233 8 311 8 233 8 311 8 392 4 19 8 beep 349 3 311 3 294 3 262 3 248 3 beep 233 8 311 8 233 8 156 8 233 8 311 8 233 8 19 8 beep 311 4 19 8 262 3 233 3 19 4 208 3 19 4 beep 196 3 19 12 175 3 19 12 156 3 19 6 32 4 19 3 43 4 6. 4DOS has a disadvantage that I have always been not very satisfied with. That is, all the fonts it writes are all lowercase. Even when displaying in the batch file, it is the same. Fortunately. 4DOS, like DBASE, provides a UPPER built-in character. When displaying, you only need to add this character. ECHO The file you called is %@UPPER 7. Often there are some small tools. All are to calculate how many lines a document has in total. Now. 4DOS can help you calculate. That is the LINES built-in character ECHO The file %1 you specified has %@LINES lines 8. 4DOS also has a useful command. When you want to perform some actions. But you have to select the files. The command SELECT of 4DOS can let you select slowly. For example. You want to delete some files in the current directory. but there is no rule to follow. Don't be nervous. 4DOS will not really let you delete one by one. You only need to add the SELECT command. SELECT DEL (*.*) SELECT will automatically display a window. Let you select with SPACE. Execute the DEL action after ENTER. Cool! It is even simpler in the batch file. You only need to add the following command. SELECT COPY (%1) %2 Or, if one day you want to mark some files to process. And output the file names to a file. (Such as using ZMODEM to send out some files. DSZ SZ -M @FILES.LST. Then you can use SELECT to create this FILES.LST. The usage is exactly the same as TELIX now.) Then just input as follows.... SELECT ECHO (*.*) >> FILES.LST 9. Today I turned over the file of 4DOS bored again. Suddenly I found that I can use a simple batch file to make a tool similar to SYSTEM INFO. I wrote it as follows..... echo Date: %_dow %_date echo Time: %_time echo 4DOS version: %_4ver echo OS: %_dos echo DOS version: %_dosver echo Video: %_video echo Monitor type: %_monitor if %_DV==1 echo DesqView Detected Ha! It is powerful.... Next time you want to judge whether it is a color screen, you don't need to spend so much effort.... ================================================================================ |
|
| Floor2 Lydong | Posted 2002-10-22 00:00 |
| 元老会员 Posts 407 Credits 1,468 From 广州 | |
|
### 4DOS Internal Variables
==================================================================== The following variables are not stored in the DOS environment. However, they can be used in commands, aliases, and batch files, just like regular environment variables. Their values are stored internally in 4DOS and cannot be changed using the SET, UNSET, or ESET commands. However, you can override these settings by using the same name, which will store the value in the environment. These internal variables can be used in 4DOS batch files or aliases to test system resources for optimal configuration. You can also directly check the values of internal variables at the 4DOS prompt, for example: c:\> echo %variablename The following commands are like regular environment variables; precede them with a % sign. -------------------------------------------------------------------- \_? Indicates the exit code of the last 4DOS command. \_4VER Stores the version of 4DOS. \_ALIAS Displays the remaining space for aliases in bytes. \_ANSI Detects if the ANSI driver is loaded. 1 means yes, 0 means no. \_BATCH Displays the current batch file nesting level. "0" means no batch file is executing. \_BG Displays the current screen background color (first three characters). For example, the general state is "yla". \_BOOT Displays the boot drive without any symbols, e.g., "c". \_CODEPAGE Displays the current code page number. \_COLUMN Displays the current cursor column number (usually "0"). \_COLUMNS Displays the number of available columns on the screen (usually "80"). \_CPU Displays the CPU type: 86 -> 8086 and 8088 286 -> 80286 186 -> 80186 and 80188 386 -> i386 200 -> NEC V20 and V30 486 -> i486 \_CWD Displays the current directory (including the drive letter). \_CWDS Displays the current directory (same as CWD but ends with a "\"). \_CWP Displays the current directory (excluding the drive letter). \_CWPS Displays the current directory (same as CWP but ends with a "\"). \_DATE Displays the current date. \_DISK Displays the current drive letter. \_DOS Displays the current system (usually either "DOS" or "OS2"). \_DOSVER Displays the current DOS version (e.g., "5.0"): (OS/2 1.2 -> 10.2 OS/2 1.3 -> 10.3 OS/2 2.0 -> 20.0 ... etc.) \_DOW Displays the current day of the week (first three characters, e.g., "Mon", "Tue"). \_DV Displays if DESQView is loaded ("1" means loaded, "0" means not loaded). \_ENV Displays the remaining space in the environment in bytes. \_FG Displays the current screen foreground color (first three characters, e.g., "Whi" means white). \_LASTDISK Displays the last allowed drive letter without any symbols, e.g., "d". \_MONITOR Displays the screen type ("mono" or "color"). \_MOUSE Displays if the mouse driver is loaded ("1" means loaded, "0" means not loaded). \_NDP Displays the coprocessor type: 0 -> no coprocessor is installed 87 -> 8087 287 -> 80287 387 -> 80387 or 80486DX \_ROW Displays the current cursor row number. \_ROWS Displays the number of available rows on the screen (usually 25). \_SHELL Displays the current shell nesting level. \_TIME Displays the current time. \_TRANSIENT is 1 if the current shell is transient (started with a /C), or 0 otherwise. \_VIDEO Displays the video card type ("mono", "cga", "ega", or "vga"). \_WIN Displays the current Windows status: 0 No Windows running 1 Windows 2 2 Windows 3 in 386 enhanced mode 3 Windows 3 in real or standard mode 20 OS/2 2.0 DOS machine with Windows support The case of variables _CWD, _CWDS, _CWP, _CWPS, and _DISK depends on your SETDOS settings (SETDOS/U=1 for uppercase) or your 4DOS.INI settings. The values of _MONITOR and _VIDEO are always lowercase. The first letter of _BG, _DOW, and _FG is uppercase, and the rest are lowercase. You can configure your system as needed. Here is an example: In the following batch file, set the screen color based on the video card type: iff "%_video"=="mono" then color bright white on black else color bright white on blue endiff If DESQView is loaded, call dvstart.bat: if "%_dv" == "1" call dvstart Output the current time and files in the current directory to dirsave: echo Directory as of %_date %_time > dirsave dir >> dirsave Set different prompts and foreground colors when in a shell: iff %_shell==0 then prompt $t $p$g color %_fg on blue else prompt [$z] $p$g color %_fg on cyan endiff ==================================================================== ## 4DOS Function Variables ==================================================================== Function variables are similar to internal variables but handle possibly non-specific values. They are prefixed with "%@" instead of "%_". When you see parameters like "b|k|m" below, unless otherwise specified, they generally mean: b Returns the result in bytes K Returns the result in kilobytes (bytes / 1024) k Returns the result in thousands of bytes (bytes / 1000) M Returns the result in megabytes (bytes / 1048576) m Returns the result in millions of bytes (bytes / 1000000) -------------------------------------------------------------------- @ALIAS[name]: Returns the content of the alias named name. @ASCII[c]: Returns the ASCII code of character c. @ATTRIB[filename,attrib]: Returns "1" or "0" indicating if the specified attribute is set for the file. The filename is the target file, and the attribute parameters are: N Normal (no attribute bits set) R Read-only H Hidden S System D Directory A Archive These attributes (except "N") can be combined, but "1" is returned only if all specified attributes are set. @CHAR[n]: n is a number, returns the corresponding ASCII character. For example, %@CHAR[65] -> A. @DATE[mm-dd-yy]: Returns the number of days from January 1, 1980, to the specified date. @DESCRIPT[filename]: Returns the description of the specified file (the description added with the describe command). @DEVICE[name]: Returns "1" or "0" indicating if the specified device (printer, com1, com2, etc.) is in use. @DISKFREE[d:,b|k|m]: Returns the free space on the specified drive. @DISKTOTAL[d:,b|k|m]: Returns the total space on the specified drive. @DISKUSED[d:,b|k|m]: Returns the used space on the specified drive. @DOSMEM[b|k|m]: Returns the remaining base memory (640 base memory) space. @EMS[b|k|m]: Returns the remaining EMS space. @EVAL[expression]: Performs mathematical operations, returning the result. Supports +, -, *, /, and % (remainder). Can use environment variables, regular variables, and parentheses (). Supports up to 16-bit integers and 8 decimal places. @EXEC[command]: Executes the specified command. The command can include 4DOS aliases, built-in commands, external commands, .btm files, and .bat files. @EXT[filename]: Returns the extension of the specified filename (without the leading period). @EXTENDED[b|k|m]: Returns the total extended memory space. @FILEDATE[filename]: Returns the date of the specified file. @FILESIZE[filename,b|k|m]: Returns the size of the specified file. @FILETIME[filename]: Returns the time a file was last modified, in hh:mm format. The separator character varies with the country setting on your system. @FULL[filename]: Returns the full path and filename of the specified file. If the filename has no path, returns the current path plus the filename. @INDEX[string1,string2]: Returns -1 if string2 is not in string1, or the starting position (starting from 0) if it is. @INT[n]: Returns the integer part of n (sign is preserved; characters after the number are truncated). @LABEL[d:]: Returns the label of the specified drive. @LEN[string]: Returns the length of the specified string. @LINE[filename,n]: Returns the nth line of the specified file. If n exceeds the number of lines, returns "**EOF**". @LINES[filename]: Returns the number of lines in the specified file minus 1. Returns 0 if there's only one line. Returns -1 if the file doesn't exist. @LOWER[string]: Returns the lowercase version of the specified string. @LPT[n]: Returns 1 if LPTn is connected, 0 otherwise. @MAKEDATE[n]: Returns the date corresponding to the nth day since January 1, 1980, the opposite of @DATE. @MAKETIME[n]: Returns the time corresponding to the nth second since 00:00:00. @NAME[filename]: Returns the base name of the specified file (without path or extension). @PATH[filename]: Returns the full path of the specified file. @READSCR[row,col,length]: Returns the text starting at row row, column col, with length length on the current screen. @READY[d:]: Returns "1" or "0" indicating if the drive is ready (usually for floppy disks). @REMOTE[d:]: Returns "1" or "0" indicating if the drive is remote (network). @REMOVABLE[d:]: Returns "1" or "0" indicating if the drive is removable. @SEARCH[filename]: Returns the full path and filename of the specified file (base name) if it exists in the path. Otherwise, returns nothing. @SELECT[filename,top,left,bottom,right,title]: Creates a temporary window on the screen from row top to bottom, column left to right, with title title. The window can be navigated with arrow keys. Pressing ESC returns no value, pressing ENTER returns the line number the cursor is on (limited to the window length). @SUBSTR[string,start,length]: Returns length characters from string starting at start + 1. string can be a variable (e.g., %_time). @TIME[hh:mm:ss]: Returns the number of seconds from 00:00:00 to hh:mm:ss. @TRUENAME[filename]: Returns the full path and filename. @UNIQUE[d:\path]: Creates a zero-length file with a unique name in the specified directory and returns the full path and unique name. @UPPER[string]: Returns the uppercase version of the specified string. @WORD[n,string]: Returns the (n+1)th word in string. If n is negative, counts from the end: %@WORD[2,NOW IS THE TIME] -> "THE" %@WORD[-0,NOW IS THE TIME] -> "TIME" %@WORD[-2,NOW IS THE TIME] -> "IS" @XMS[b|k|m]: Returns the total XMS space. ==================================================================== ==================================================================== You can use the above variables as needed, or with prompts (see the original manual). For example: c:\> prompt (%%@dosmem[K]K) $p$g Or set up a simple online calculator: c:\> alias calc `echo The answer is: %@eval[%&]` Here's a simple example using date and time to trigger actions. This batch file only sets that if the current date is greater than the recorded date and the current time is after 6 AM, it records the current date in a log file. For reference only, feel free to use: rem DD is _date, DY is yymmdd date, TM is _time set dd=%_date set dy=%@substr[%dd,6,2]%@substr[%dd,0,2]%@substr[%dd,3,2] set lastdate=0 iff exist c:\onceaday.dat then set lastdate=%@line[onceaday.dat,0] endiff iff %dy gt %lastdate then set tm=%_time iff "%@substr[%tm,0,2]%@substr[%tm,3,2]" gt "0600" then rem Conditions met, execute program echo %dy > c:\onceaday.dat endiff endiff |
|
| Floor3 wcr100 | Posted 2010-12-20 14:54 |
| 初级用户 Posts 13 Credits 27 | |
|
That's really nice, I'm using it right now
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |