China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-15 13:12
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » A small issue with cleverly using lmod in batch files to read file information View 2,109 Replies 1
Original Poster Posted 2009-02-06 16:14 ·  中国 湖南 郴州 电信
初级用户
Credits 27
Posts 13
Joined 2006-09-10 00:17
19-year member
UID 62254
Gender Male
Status Offline
For convenience in testing, edit.com is used in place of winxpsp3.gho for testing.
Among them, the result of LMODEXp6.BAT is a little different from the free space shown by dir, and I don't know what's going on.

lmodexp1.bat
vol | lmod /L1 set label=[$!] >labelexp.bat
call labelexp.bat
echo The detected volume label of this partition is %label%

LMODEXp2.BAT
dir edit.com | lmod /L5 set filedate=[29,25] >filedate.bat
call filedate.bat
echo The detected time of the last system backup is %filedate%

LMODEXp3.BAT
dir edit.com | lmod /L5 set filedate=The detected time of the last system backup is [29,25] >filedate.bat
call filedate.bat
echo %filedate%

LMODEXp4.BAT
dir edit.com | lmod /L5 set filename= [1,8].[10,3] >filename.bat
call filename.bat
echo The detected name of the last system backup is %filename%

LMODEXp5.BAT
dir edit.com | lmod /L5 set filesize=[13,16] >filesize.bat
call filesize.bat
echo The detected size of the last system backup is %filesize% bytes

LMODEXp6.BAT
dir edit.com | lmod /L8 set freesize=[18,17] >freesize.bat
call freesize.bat
echo The detected free space of the current partition is %freesize% bytes
Attachments
study.rar (3.05 KiB, Downloads: 29)
Floor 2 Posted 2010-11-09 19:15 ·  中国 广东 佛山 电信
初级用户
Credits 59
Posts 28
Joined 2010-11-05 01:45
15-year member
UID 177110
Gender Male
Status Offline
Long live, long long live
Forum Jump: