中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » 请教关于98 dos下 查询磁盘剩余空间的问题
« [1] [2] »
作者:
标题: 请教关于98 dos下 查询磁盘剩余空间的问题 上一主题 | 下一主题
fjdcxnp
新手上路





积分 25
发帖 12
注册 2010-11-15
状态 离线
『楼 主』:  请教关于98 dos下 查询磁盘剩余空间的问题

各位大侠:
我目前遇到这样一个需求,在dos 系统下(dos version : Window 98 4.10.2222),在批处理文件中,查询一个磁盘(FAT,启动盘)剩余空间的大小,如果大于1G,提示用户。
通过这版本上DOS自带的命令或者外部命令(*.EXE 必须是免费允许各种用途)实现,熟悉的bat 编程的高手帮忙给点建议,谢谢哦
目前我有FIND.EXE,FDISK.EXE,CHKDSK.EXE等

[ Last edited by fjdcxnp on 2010-12-27 at 20:24 ]

2010-12-21 20:00
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
DOSforever
金牌会员





积分 4633
发帖 2236
注册 2005-1-30
状态 离线
『第 2 楼』:  



  Quote:
Originally posted by fjdcxnp at 2010-12-21 20:00:
……
我想用for ,set 等语句来实现,但是这个版本下似乎不支持这些语句
(我试过,它不识别这些语句),
想通过find 语句实现,但是没找到这个版本下相应的find.exe

Windows 98 4.10.2222 所相应的 DOS 版本是 MS-DOS 7.10 ,不可能不支持 for 和 set 命令。for 和 set 是内部命令,不需要单独的可执行文件。
Windows 98 的 FIND.EXE 文件在 \WINDOWS\COMMAND 目录下。

不过我不需要用这些命令来实现你的目的。

[ Last edited by DOSforever on 2010-12-22 at 01:40 ]



DOS倒下了,但永远不死
DOS NEVER DIES !

投票调查:
http://www.cn-dos.net/forum/viewthread.php?tid=46187

本人尚未解决的疑难问题:
http://www.cn-dos.net/forum/viewthread.php?tid=15135
http://www.cn-dos.net/forum/viewthread.php?tid=47663
http://www.cn-dos.net/forum/viewthread.php?tid=48747
2010-12-21 21:41
查看资料  发短消息 网志   编辑帖子  回复  引用回复
fjdcxnp
新手上路





积分 25
发帖 12
注册 2010-11-15
状态 离线
『第 3 楼』:  

非常感谢
1.我用for 语句,它提示是"syntax error"(如果没记错的话,总之提示错误),
以你看,可能是什么原因
2.请教还有什么办法可以实现,谢谢!

2010-12-22 18:14
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
DOSforever
金牌会员





积分 4633
发帖 2236
注册 2005-1-30
状态 离线
『第 4 楼』:  

可以用 4DOS 的 @diskfree 变量函数

  Quote:
4DOS Help Topic:  @DISKFREE


@DISKFREE[d:,b|k|m|g]: Returns the amount of free disk space on the
specified drive.  DOS networks with large server disk drives (over 2 GB) may
report disk space values that are too small when @DISKFREE is used.  If this
occurs, it is because the network software does not report the proper values
to 4DOS.



2010-12-22 19:23
查看资料  发短消息 网志   编辑帖子  回复  引用回复
jinqiaoa1a
初级用户





积分 36
发帖 20
注册 2007-1-27
状态 离线
『第 5 楼』:  

两位高手的对话,我什么也看不懂,佩服并羡慕中

2010-12-23 08:18
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
fjdcxnp
新手上路





积分 25
发帖 12
注册 2010-11-15
状态 离线
『第 6 楼』:  



  Quote:
Originally posted by DOSforever at 2010-12-22 19:23:
可以用 4DOS 的 @diskfree 变量函数

感谢 DOSforever!!!
1由于其他原因可能我无法使用4DOS.... 。
2.我今天重新试了下for 语句,如你所言,是可以使用的,只是功能比较弱的,
以下是 这个版本的 for 语句
Runs a specified command for each file in a set of files.

FOR %variable IN (set) DO command [command-parameters]

  %variable  Specifies a replaceable parameter.
  (set)      Specifies a set of one or more files.  Wildcards may be used.
  command    Specifies the command to carry out for each file.
  command-parameters
             Specifies parameters or switches for the specified command.

To use the FOR command in a batch program, specify %%variable instead of
%variable.

3.我也找到的FIND.EXE

我想尝试通过for ,find 之类的DOS 内部或者外部命令实现,给点建议呀。

如果各位熟悉DOS bat 编程,提供些实现的示范呀,谢谢(本人不太熟悉DOS 编程,最近有临时需要才接触)

[ Last edited by fjdcxnp on 2010-12-27 at 19:42 ]

2010-12-23 18:26
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
fjdcxnp
新手上路





积分 25
发帖 12
注册 2010-11-15
状态 离线
『第 7 楼』:  



  Quote:
Originally posted by jinqiaoa1a at 2010-12-23 08:18:
两位高手的对话,我什么也看不懂,佩服并羡慕中

我最近刚接触....不懂

2010-12-23 18:27
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
DOSforever
金牌会员





积分 4633
发帖 2236
注册 2005-1-30
状态 离线
『第 8 楼』:  

为什么无法使用 4DOS ?找不到下载?
你可以用“剩余空间”作为关键字在这个版块搜索一下。

2010-12-24 20:07
查看资料  发短消息 网志   编辑帖子  回复  引用回复
HAT
版主





积分 9023
发帖 5017
注册 2007-5-31
状态 离线
『第 9 楼』:  

DOS下如何检测分区的剩余空间?
http://www.cn-dos.net/forum/viewthread.php?tid=15017



2010-12-26 16:12
查看资料  发短消息 网志   编辑帖子  回复  引用回复
fjdcxnp
新手上路





积分 25
发帖 12
注册 2010-11-15
状态 离线
『第 10 楼』:  



  Quote:
Originally posted by DOSforever at 2010-12-24 20:07:
为什么无法使用 4DOS ?找不到下载?
你可以用“剩余空间”作为关键字在这个版块搜索一下。

谢谢。
不是的,
1.我目前做的是在原有的bat file上添加些东西,如果改用4DOS可能会影响原有的应用,各种*.EXE
2.我查了4DOS , http://en.wikipedia.org/wiki/4DOS
它对商业用途有限制,不是随意用的,由于不是我自己个人使用,不想惹麻烦(虽然惹麻烦的几率应该为0)

我在发帖之前查过目前的已有的查询剩余空间的办法,但我无法使用上,
1.用for
http://www.cn-dos.net/forum/viewthread.php?tid=19738
我试过,for 语句在我的目前的DOS 下很弱,不支持-f.....
2.用GET.EXE
http://www.cn-dos.net/forum/viewthread.php?tid=15017
GET.EXE 应该是正版收费的..

现在试着用for 和 FIND.EXE ,但估计挺麻烦的。

2010-12-26 18:53
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
fjdcxnp
新手上路





积分 25
发帖 12
注册 2010-11-15
状态 离线
『第 11 楼』:  



  Quote:
Originally posted by HAT at 2010-12-26 16:12:
DOS下如何检测分区的剩余空间?
http://www.cn-dos.net/forum/viewthread.php?tid=15017

谢谢,但是GET.EXE 并非开源免费随便用的,
谢谢

2010-12-26 18:54
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
DOSforever
金牌会员





积分 4633
发帖 2236
注册 2005-1-30
状态 离线
『第 12 楼』:  

呵呵,谢谢 fjdcxnp ,看来你还挺仔细的。我只记得 4DOS 从 7.50 版起就是 Freeware 了,还没注意到你说的“商业用途有限制”。我看了下你给的 4DOS 的 Wiki 链接,我的英文不太好,按照 History and current status 中这段话的意思

  Quote:
Originally distributed as shareware, 4DOS has been later released as unsupported freeware. Currently, the source code is available under a modified MIT License but it "may not be used in any commercial product without written permission from Rex Conn"

我的理解是,源代码不能用于商业产品,除非得到 Rex Conn 的许可,但 4DOS 软件本身是 Freeware 。

这是 7.50 版的 LICENSE.TXT 内容:

  Quote:

Copyright (c) 1989-2004 JP Software, Inc.
-----------------------------------------

4DOS (including software, documents, or other related items) is being
provided by JP Software under the following license. By obtaining,
using and/or copying this work, you (the licensee) agree that you have read,
understood, and will comply with the following terms and conditions:

Permission to use, copy, modify, and distribute this software and its
documentation, with or without modification, for any purpose and without fee
or royalty is hereby granted, provided that you include the following on ALL
copies of the software and documentation or portions thereof, including
modifications, that you make:

  1. The full text of this notice in a location viewable to users of the
  redistributed or derivative work.

  2. Notice of any changes or modifications to the files, including the date
  changes were made.

  3. You may charge a distribution fee for the physical act of transferring a
  copy, and you may at your option offer warranty protection in exchange for a
  fee.

  4. You may not copy, sublicense, distribute or transfer 4DOS except as
  expressly provided under this License Agreement, without prior written
  permission from JP Sofrware. Any attempt otherwise to copy, sublicense,
  distribute or transfer 4DOS is void and your rights to use the program
  under this License agreement shall be automatically terminated.

THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND JP SOFTWARE MAKES
NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.

JP SOFTWARE WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.

The name of JP Software may NOT be used in advertising or publicity
pertaining to the software without specific, written prior permission.
Title to copyright in this software and any associated documentation will
at all times remain with JP Software.

这是 8.00 版的 LICENSE.TXT 内容:

  Quote:

Copyright (c) 1989-2004 JP Software, Inc.
-----------------------------------------

4DOS (including software, documents, or other related items) is being
provided by JP Software under the following license. By obtaining,
using and/or copying this work, you (the licensee) agree that you have read,
understood, and will comply with the following terms and conditions:

Permission to use, copy, modify, and distribute this software and its
documentation, with or without modification, for any purpose and without fee
or royalty is hereby granted, provided that you include the following on ALL
copies of the software and documentation or portions thereof, including
modifications, that you make:

  1. The full text of this notice in a location viewable to users of the
  redistributed or derivative work.

  2. Notice of any changes or modifications to the files, including the date
  changes were made.

  3. You may charge a distribution fee for the physical act of transferring a
  copy, and you may at your option offer warranty protection in exchange for a
  fee.

  4. You may not copy, sublicense, distribute or transfer 4DOS except as
  expressly provided under this License Agreement, without prior written
  permission from JP Sofrware. Any attempt otherwise to copy, sublicense,
  distribute or transfer 4DOS is void and your rights to use the program
  under this License agreement shall be automatically terminated.

THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND JP SOFTWARE MAKES
NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.

JP SOFTWARE WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.

The name of JP Software may NOT be used in advertising or publicity
pertaining to the software without specific, written prior permission.
Title to copyright in this software and any associated documentation will
at all times remain with JP Software.

你看一下,如果使用的话会不会给你带来版权上的麻烦。

[ Last edited by DOSforever on 2010-12-26 at 20:54 ]

2010-12-26 20:52
查看资料  发短消息 网志   编辑帖子  回复  引用回复
DOSforever
金牌会员





积分 4633
发帖 2236
注册 2005-1-30
状态 离线
『第 13 楼』:  

接下来我们再讨论下技术性问题

  Quote:
Originally posted by fjdcxnp at 2010-12-26 18:53:

1.我目前做的是在原有的bat file上添加些东西,如果改用4DOS可能会影响原有的应用,各种*.EXE

关于改用 4DOS 后对原有 BAT 的影响,我是这么认为的:
http://www.cn-dos.net/forum/viewthread.php?tid=15214#pid91455

  Quote:
4DOS与传统的COMMAND.COM相比变化确实很大,但它并不是改变了COMMAND.COM原有的语法和参数,而是在它的基础上加以扩充,你也可以完全按照使用COMMAND.COM的习惯来使用它,原来在COMMAND.COM下编写的BATCH可以不加任何修改地在4DOS下运行……

当然,我本人没经过100%验证,具体你的应用还要你自己验证下。

  Quote:
Originally posted by fjdcxnp at 2010-12-23 18:26:

如果各位熟悉DOS bat 编程,提供些实现的示范呀,谢谢(本人不太熟悉DOS 编程,最近有临时需要才接触)

BAT 根本算不上编程,编写批处理不叫编程,编写批处理根本上不了编程这个档次。在这里,我看到许多人要个什么批处理代码什么的,我对此嗤之以鼻,代码这个词我认为批处理还没这个资格用。

2010-12-26 21:08
查看资料  发短消息 网志   编辑帖子  回复  引用回复
fjdcxnp
新手上路





积分 25
发帖 12
注册 2010-11-15
状态 离线
『第 14 楼』:  



  Quote:
Originally posted by DOSforever at 2010-12-26 20:52:
呵呵,谢谢 fjdcxnp ,看来你还挺仔细的。我只记得 4DOS 从 7.50 版起就是 Freeware 了,还没注意到你说的“商业用途有限制”。我看了下你给的 4DOS 的 Wik ...

谢谢提供原版声明,我看了下,没发现什么问题,应该也能用
(与GNU还是不同的,不太确定),
谢谢

2010-12-27 19:51
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
fjdcxnp
新手上路





积分 25
发帖 12
注册 2010-11-15
状态 离线
『第 15 楼』:  



  Quote:
Originally posted by DOSforever at 2010-12-26 21:08:
接下来我们再讨论下技术性问题


关于改用 4DOS 后对原有 BAT 的影响,我是这么认为的:
http://www.cn-dos.net/forum/viewthread.php?tid=15214#pid91455

...

1.我搜索了下4DOS ,还没找到合适的下载,也没试过
2.我现在要做的磁盘查询相对与目前这个bat file 实现的功能,算是很小的一部分,如果因此改用4DOS ,风险,代价还是大的。
所以我倾向于用目前已有的一些免费的EXE来实现,
感谢

看过论坛极类似的问题,好像也没有解决
http://www.cn-dos.net/forum/view ... 9%E7%A9%BA%E9%97%B4

2010-12-27 20:10
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
« [1] [2] »
请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: