|
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
金牌会员
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2010-12-21 21:41 |
|
|
fjdcxnp
新手上路
积分 25
发帖 12
注册 2010-11-15
状态 离线
|
『第
3 楼』:
非常感谢
1.我用for 语句,它提示是"syntax error"(如果没记错的话,总之提示错误),
以你看,可能是什么原因
2.请教还有什么办法可以实现,谢谢!
|
|
2010-12-22 18:14 |
|
|
DOSforever
金牌会员
积分 4639
发帖 2239
注册 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
金牌会员
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
『第
8 楼』:
为什么无法使用 4DOS ?找不到下载?
你可以用“剩余空间”作为关键字在这个版块搜索一下。
|
|
2010-12-24 20:07 |
|
|
HAT
版主
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
|
2010-12-26 16:12 |
|
|
fjdcxnp
新手上路
积分 25
发帖 12
注册 2010-11-15
状态 离线
|
|
2010-12-26 18:53 |
|
|
fjdcxnp
新手上路
积分 25
发帖 12
注册 2010-11-15
状态 离线
|
『第
11 楼』:
谢谢,但是GET.EXE 并非开源免费随便用的,
谢谢
|
|
2010-12-26 18:54 |
|
|
DOSforever
金牌会员
积分 4639
发帖 2239
注册 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
金牌会员
积分 4639
发帖 2239
注册 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
状态 离线
|
|
2010-12-27 20:10 |
|