测试平台:MS-DOS7.1 @ Virtual PC 5.2(418)
其他说明:采用MS-DOS7.1光盘完整版选择性安装,启动配置除加入VPC的附 件包外未作其他改动。
1、第一个问题出现的比较早,使用VPC自带的fshare实现文件共享,但在创建的共享盘中,可以创建、修改、浏览文件,但是无法删除文件。
下面是测试代码:
------------------- test1.bat ------------------
@echo off
echo 1>test.txt
echo 2>test.txt
del test.txt
type test.txt
------------------- test1.bat ------------------
下面是测试结果:
File not found
2
在同一虚拟机中MSDOS6.22和Win98 command中的结果正确,也即未找到文件test.txt。
2、第二个问题最近才发现,就是如果当前路径下存在test文件,那么测试test目录存在的语句(if exist test\nul)返回真值并执行其后的语句。
下面是测试代码:
------------------- test2.bat ------------------
@echo off
echo 1>test
if exist test\nul echo test dir exist
echo 1>test.txt
if exsit test.txt\nul echo test.txt dir exist
------------------- test2.bat ------------------
下面是测试结果:
test dir exist
test.txt dir exist
在同一虚拟机中MSDOS6.22和Win98 command中的结果正确,也即无任何输出。
其他说明:采用MS-DOS7.1光盘完整版选择性安装,启动配置除加入VPC的附 件包外未作其他改动。
1、第一个问题出现的比较早,使用VPC自带的fshare实现文件共享,但在创建的共享盘中,可以创建、修改、浏览文件,但是无法删除文件。
下面是测试代码:
------------------- test1.bat ------------------
@echo off
echo 1>test.txt
echo 2>test.txt
del test.txt
type test.txt
------------------- test1.bat ------------------
下面是测试结果:
File not found
2
在同一虚拟机中MSDOS6.22和Win98 command中的结果正确,也即未找到文件test.txt。
2、第二个问题最近才发现,就是如果当前路径下存在test文件,那么测试test目录存在的语句(if exist test\nul)返回真值并执行其后的语句。
下面是测试代码:
------------------- test2.bat ------------------
@echo off
echo 1>test
if exist test\nul echo test dir exist
echo 1>test.txt
if exsit test.txt\nul echo test.txt dir exist
------------------- test2.bat ------------------
下面是测试结果:
test dir exist
test.txt dir exist
在同一虚拟机中MSDOS6.22和Win98 command中的结果正确,也即无任何输出。
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!

