|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『楼 主』:
老病新药:非中文环境下进入中文目录
使用 LLM 解释/回答一下
To All:
在不加载任何汉字系统或平台的纯DOS环境下,如何进入中文目录,这是一个老问题了。在使用启动盘恢复系统时可能会遇到它,如果Ghost镜像所在的目录是个中文名,一张普通的Win98启动盘肯定是没有中文环境支持的,这时候,我们该怎么办?
一个经典且流行的解决办法是dir>file,然后再edit file,将其中的中文乱码部分保留下来,然后在前面加上cd空格,保存为enter.bat,然后回到DOS下,就可以enter进入中文目录了。
然而这不是“老病新药”的初衷,我的题目是,如何只用内部命令进入中文目录,所以edit被无情的抛弃了。
题目的详细描述如下:
1、目标磁盘D:下仅存在一个目录,名为“测试”,如何在命令行仅使用DOS内部命令进入此目录。
2、D:下存在两个目录,分别名为“测试”和“test”,其他同1;
3、D:下存在两个目录,分别名为“测试”和“测试2”,其他同1;
4、D:下存在两个目录,名均为中文,其中仅有一个目录中包含一名为test.dat的文件,如何在命令行仅使用DOS内部命令进入此目录;
5、D:下存在三个目录,名均为中文,仅有一个目录中包含一名为 test.dat 的文件,其他同4;
6、D:下存在三个目录,分别名为“测试1”、“测试2”、“测试3”,如何在命令行仅使用DOS内部命令进入“测试2”目录;
7、D:下存在三个目录,分别名为“测试一”、“测试二”,“测试三”,如何在命令行仅使用DOS内部命令进入“测试三”目录;
Last:在批处理中实现以上需求,批处理中仍然不能使用任何外部命令。
Last edited by willsort on 2006-4-18 at 23:25 ]
To All:
In a pure DOS environment without loading any Chinese character system or platform, how to enter a Chinese - named directory is an old problem. It may be encountered when using a boot disk to restore the system. If the directory where the Ghost image is located has a Chinese name, an ordinary Win98 boot disk definitely has no Chinese environment support. At this time, what should we do?
A classic and popular solution is to use dir>file, then edit file, keep the Chinese garbled part, then add cd space in front, save it as enter.bat, and then return to DOS, and then you can enter the Chinese - named directory by entering enter.
However, this is not the original intention of "old problem new medicine". My question is, how to enter a Chinese - named directory using only internal commands, so edit is ruthlessly abandoned.
The detailed description of the question is as follows:
1. There is only one directory named "Test" under the target disk D:. How to enter this directory at the command line using only DOS internal commands.
2. There are two directories under D:, named "Test" and "test" respectively, the rest are the same as 1;
3. There are two directories under D:, named "Test" and "Test 2" respectively, the rest are the same as 1;
4. There are two directories under D:, both with Chinese names, and only one directory contains a file named test.dat. How to enter this directory at the command line using only DOS internal commands;
5. There are three directories under D:, all with Chinese names, and only one directory contains a file named test.dat, the rest are the same as 4;
6. There are three directories under D:, named "Test 1", "Test 2", "Test 3" respectively. How to enter the "Test 2" directory at the command line using only DOS internal commands;
7. There are three directories under D:, named "Test One", "Test Two", "Test Three" respectively. How to enter the "Test Three" directory at the command line using only DOS internal commands;
Last: Realize the above requirements in a batch file. No external commands can be used in the batch file either.
Last edited by willsort on 2006 - 4 - 18 at 23:25 ]
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-9-2 17:36 |
|
|
chujiafu
银牌会员
    
积分 1337
发帖 594
注册 2004-5-26 来自 安徽 宿州
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
的确是个挑战。学习……
It is indeed a challenge. Learning...
|
|
2005-9-4 18:42 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
嘿嘿,debug + for + find,估计着可以解决,但没有什么实用价值。
研究这个问题我认为也没有什么太大的实用价值。纯技术性的吧。
Hehe, debug + for + find, I estimate it can be solved, but there's no practical value.
I think researching this problem also has no great practical value. It's purely technical.
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2005-9-4 19:38 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
Re Climbing:
debug和find都是外部命令,是在题目限制之外的。
至于题目的实用性,在遇到用单纯的DOS/Win98引导盘(只含引导必须文件)进入系统中的中文目录是有用的,这种情况我过去曾遇到过许多次。
题目的难度应该不是很大,我将着手再增加几个子题。
Last edited by willsort on 2005-9-4 at 20:32 ]
Re Climbing:
debug and find are both external commands, which are outside the scope of the problem.
As for the practicality of the problem, it is useful when encountering Chinese directories in the system entered with a simple DOS/Win98 boot disk (containing only the essential boot files). I have encountered many such situations in the past.
The difficulty of the problem should not be very great. I will start to add a few more sub - problems.
Last edited by willsort on 2005-9-4 at 20:32 ]
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-9-4 19:54 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
说实在的,DOS有哪些内部命令我都搞不太清楚,不能用debug和find,那只好用prompt了,还是等着你公布答案学习吧,嘿嘿
To be honest, I'm not very clear about which internal commands DOS has. Since I can't use debug and find, I'll just use prompt. I'll just wait for you to announce the answer to learn. Hehe
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2005-9-4 20:47 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
Re Climbing:
DOS的内部命令就是COMMAND.COM内部支持的命令,这个查阅MS-DOS的帮助文档就可以得到了。此题目所用到的内部命令不会很多,也不会有很偏僻的用法,大约就是dir/cd/copy等几个命令,可能会用到一些简单的批处理,prompt我到没有考虑过。
另外,需要注意的是,前面的问题子项都是互相独立的,没有顺序性,也没有要求全部实现,我自己也只有大概的思路,而且除了最后一个子项外,其他都是要求在命令行实现的,这就增加了许多操作上的自由度。
Re Climbing:
The internal commands of DOS are the commands supported internally by COMMAND.COM, which can be obtained by referring to the help documentation of MS-DOS. The internal commands used in this question will not be many, and there will not be very obscure usages. Probably just a few commands like dir/cd/copy, and some simple batch processing might be used. I didn't consider prompt.
In addition, it should be noted that the previous sub-questions are all independent of each other, there is no order, and there is no requirement to implement all of them. I only have a general idea myself, and except for the last sub-question, the others are all required to be implemented at the command line, which increases a lot of operational freedom.
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-9-4 21:10 |
|
|
badcfqtd
中级用户
  
积分 232
发帖 53
注册 2005-8-24 来自 中国
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
Originally posted by willsort at 2005-9-2 17:36:
To All:
在不加载任何汉字系统或平台的纯DOS环境下,如何进入中文目录,这是一个老问题了。在使用启动盘恢复系统时可能会遇到它,如果Ghost镠...
不知道是怎么的,我的机子老是出毛病,不听话。我按你的老方法作了个试验结果是得到这样的信息:The filename,directory name,or volume label syntax is incorrect. 这句话的意思大致是说,文件名,目录名或者标签句法不正确,这是什么原因呢?
Last edited by badcfqtd on 2005-9-4 at 23:15 ]
Originally posted by willsort at 2005-9-2 17:36:
To All:
In a pure DOS environment without loading any Chinese character system or platform, how to enter a Chinese directory is an old problem. It may be encountered when using a boot disk to restore the system. If Ghost...
I don't know what's wrong, my computer always has problems and doesn't behave. I did a test according to your old method and got this message:The filename,directory name,or volume label syntax is incorrect. The general meaning of this sentence is that the filename, directory name, or volume label syntax is incorrect. What is the reason for this?
Last edited by badcfqtd on 2005-9-4 at 23:15 ]
|
|
2005-9-4 23:13 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
Re badcfqtd:
请贴出你的enter.bat的详细内容。
Re badcfqtd:
Please post the detailed content of your enter.bat in detail
请贴出你的enter.bat的详细内容请以自然流畅的英文书面语呈现,保持专业、冷静且符合复古计算、DOS等技术相关主题的语气。请贴出你的enter.bat的详细内容
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-9-5 12:41 |
|
|
badcfqtd
中级用户
  
积分 232
发帖 53
注册 2005-8-24 来自 中国
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
不用了,谢谢.俺了瑞在MS-DOS下的确不能用.不过,我在咱联盟下载的DOS711居然没有EDIT.EXE难怪老是提示错误命令.不过,把WINXP的那个EDIT.EXE复制过去能用也就将就用了.
Last edited by badcfqtd on 2005-9-5 at 18:01 ]
No, thank you. Actually, it really can't be used under MS-DOS. But the DOS711 I downloaded from our union doesn't have EDIT.EXE, which is why it always prompts an error command. However, copying the EDIT.EXE from WINXP over works, so I'll just make do with it.
Last edited by badcfqtd on 2005-9-5 at 18:01 ]
|
|
2005-9-5 17:14 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
Re All:
我先给出第1题的我的方案吧,按顺序在命令行下执行以下命令:
d:
cd \
copy con enter.bat
cd (键入Ctrl+Z或者键入“F6”键,不含括号)
dir /ad /b>>enter.bat
enter
Last edited by willsort on 2005-9-8 at 11:21 ]
Re All:
Let me first present my solution for question 1. Execute the following commands in sequence at the command line:
d:
cd \
copy con enter.bat
cd (Type Ctrl+Z or press the "F6" key, without parentheses)
dir /ad /b>>enter.bat
enter
Last edited by willsort on 2005-9-8 at 11:21 ]
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-9-6 19:31 |
|
|
chenhui530
高级用户
   
积分 772
发帖 273
注册 2004-10-23
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
我公布下下面的几个问题的方法
由于没有DOS环境所以请大家测试一下
问题2:
attrib +h +s +a /d /s
attrib -s -h test
copy con 123.bat
::输入"cd"+"空格"然后按F6
dir /adhsa /b>>123.bat
call 123.bat
问题3:
copy con 234.bat
::输入set a=再按F6
dir /ad /b>>234.bat
call 234.bat
del 234.bat
if exist %a%2 goto cd_
attrib +s +h +a /s /d *
attrib -s -h %a%
copy con 234.bat
::输入"cd"+"空格"再按F6
dir /adsha /b *>>234.bat
call 234.bat
:cd_
cd %a%
pause
问题4:
copy con 234.bat
::输入set a=再按F6
dir /ad /b>>234.bat
call 234.bat
del 234.bat
if exist %a%\test.dat goto cd_
attrib +s +h +a /s /d *
attrib -s -h %a%
copy con 234.bat
::输入"cd"+"空格"再按F6
dir /adsha /b *>>234.bat
call 234.bat
:cd_
cd %a%
pause
问题6:
copy con 234.bat
::输入set a=再按F6
dir /ad /b>>234.bat
call 234.bat
del 234.bat
attrib +h +r +a /s /d *
attrib -h -r -a %a%
copy con 234.bat
::输入"cd"+"空格"再按F6
dir /adhar /b *>>234.bat
call 234.bat
pause
I will publish the methods for the following questions.
Since there is no DOS environment, please everyone test it.
Question 2:
attrib +h +s +a /d /s
attrib -s -h test
copy con 123.bat
::Enter "cd" + "space" and then press F6
dir /adhsa /b>>123.bat
call 123.bat
Question 3:
copy con 234.bat
::Enter set a= and then press F6
dir /ad /b>>234.bat
call 234.bat
del 234.bat
if exist %a%2 goto cd_
attrib +s +h +a /s /d *
attrib -s -h %a%
copy con 234.bat
::Enter "cd" + "space" and then press F6
dir /adsha /b *>>234.bat
call 234.bat
:cd_
cd %a%
pause
Question 4:
copy con 234.bat
::Enter set a= and then press F6
dir /ad /b>>234.bat
call 234.bat
del 234.bat
if exist %a%\test.dat goto cd_
attrib +s +h +a /s /d *
attrib -s -h %a%
copy con 234.bat
::Enter "cd" + "space" and then press F6
dir /adsha /b *>>234.bat
call 234.bat
:cd_
cd %a%
pause
Question 6:
copy con 234.bat
::Enter set a= and then press F6
dir /ad /b>>234.bat
call 234.bat
del 234.bat
attrib +h +r +a /s /d *
attrib -h -r -a %a%
copy con 234.bat
::Enter "cd" + "space" and then press F6
dir /adhar /b *>>234.bat
call 234.bat
pause
|

http://www.msfans.net/bbs/ |
|
2005-9-8 10:24 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
Re chenhui530:
确实与我的思路不同,不过其中的attrib是外部命令,不符合题目限制条件。而goto命令在命令行也是不起作用的,如果你的解答是批处理,那么在copy con 语句后跟cd 或者set 无法得到你所期望的效果的。
至于测试,你可以在Windows命令行下做同样测试,只要不是中文环境即可。XP下可以command启动命令行,或者cmd启动后用chcp 437更改代码页。目录的地址也可以由D:盘根更改为其它子目录,只要解答不依赖于特殊路径即可。
现给出我的第二题的方案(在MSDOS7.1测试通过):
d:
cd\
echo cd %1>callcd.bat
copy con enter.bat
callcd (键入Ctrl+Z或F6,不输入括号)
dir /ad /o-n /b>>enter.bat
enter
───────────────── 版主提示 ─────────────────
帖中红色并带下划线的言论内容,目前被认定为是不恰当的,敬请注意!
具体讨论参见本主题22-26楼的回复帖
───────────────── 版主提示 ─────────────────
Last edited by willsort on 2006-4-19 at 15:11 ]
Re chenhui530:
Indeed different from my thinking, but the attrib there is an external command, which doesn't meet the topic restriction. And the goto command won't work in the command line either. If your solution is a batch file, then after the copy con statement, using cd or set won't get the effect you expect.
As for testing, you can do the same test in the Windows command line, as long as it's not a Chinese environment. In XP, you can start the command line with command, or after starting cmd, change the code page with chcp 437. The directory address can also be changed from the root of drive D to other subdirectories, as long as the solution doesn't depend on a special path.
Now present my solution for the second question (tested under MSDOS7.1):
d:
cd\
echo cd %1>callcd.bat
copy con enter.bat
callcd (Type Ctrl+Z or F6, without the parentheses)
dir /ad /o-n /b>>enter.bat
enter
───────────────── Moderator's Note ─────────────────
The red and underlined remarks in the post are currently deemed inappropriate. Please take note!
For specific discussion, refer to the replies in posts 22-26 of this topic
───────────────── Moderator's Note ─────────────────
Last edited by willsort on 2006-4-19 at 15:11 ]
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-9-8 11:31 |
|
|
chujiafu
银牌会员
    
积分 1337
发帖 594
注册 2004-5-26 来自 安徽 宿州
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
Re willsort兄:
现在看来,你的方案的应用还是有限的。因为在通常情况下,D:盘有N个目录和N个文件。而你的只是仅一个目录、两个目录、三个目录。
Last edited by chujiafu on 2005-9-10 at 06:53 ]
Re comrade re:
Now it seems that the application of your scheme is still limited. Because under normal circumstances, there are N directories and N files on drive D:. But yours are only one directory, two directories, three directories.
Last edited by chujiafu on 2005-9-10 at 06:53 ]
|
|
2005-9-10 06:42 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
Re chujiafu:
任何复杂的问题都是简单的部分组成的,如果能解决好这些简单的部分,那么其任何复杂的组成都应该不能难倒我们。
我的题目中所限定的一个、两个和三个目录,只是为了简化问题的复杂性,但是它已经涵盖了问题的不少方面,只要能够活学活用,就应该可以解决大部分的实际应用问题。即使所在路径有多个目录和多个文件,也可以通过各种方法来过滤出我们需要的目标。
Re chujiafu:
Any complex problem is composed of simple parts. If we can solve these simple parts well, then any complex composition should not be difficult for us.
The one, two, and three directories specified in my question are just to simplify the complexity of the problem, but they have already covered many aspects of the problem. As long as we can apply what we have learned flexibly, we should be able to solve most practical application problems. Even if there are multiple directories and multiple files in the path, we can filter out the target we need through various methods.
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-9-10 10:14 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
Re All:
现给出第3题的我的方案:
d:
cd \
copy con enter.bat
cd (键入Ctrl+Z或者键入“F6”键,不含括号)
dir ???? /ad /b>>enter.bat
enter
Re All:
Here is my solution for question 3:
d:
cd \
copy con enter.bat
cd (Type Ctrl+Z or press the "F6" key, excluding the parentheses)
dir ???? /ad /b>>enter.bat
enter
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-9-16 10:05 |
|