![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-14 02:08 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS疑难解答 & 问题讨论 (解答室) » Old illness, new medicine: Entering Chinese directories in non-Chinese environments |
| Printable Version 4,774 / 35 |
| Floor1 willsort | Posted 2005-09-02 17:36 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
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 ] |
|
| Floor2 chujiafu | Posted 2005-09-04 18:42 |
| 银牌会员 Posts 595 Credits 1,339 From 安徽 宿州 | |
|
It is indeed a challenge. Learning...
|
|
| Floor3 Climbing | Posted 2005-09-04 19:38 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
|
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. |
|
| Floor4 willsort | Posted 2005-09-04 19:54 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
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 ] |
|
| Floor5 Climbing | Posted 2005-09-04 20:47 |
| 铂金会员 Posts 2,753 Credits 6,962 From 河北保定 | |
|
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
|
|
| Floor6 willsort | Posted 2005-09-04 21:10 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
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. |
|
| Floor7 badcfqtd | Posted 2005-09-04 23:13 |
| 中级用户 Posts 53 Credits 232 From 中国 | |
Originally posted by willsort at 2005-9-2 17:36: 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 ] |
|
| Floor8 willsort | Posted 2005-09-05 12:41 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
Re badcfqtd:
Please post the detailed content of your enter.bat in detail 请贴出你的enter.bat的详细内容请以自然流畅的英文书面语呈现,保持专业、冷静且符合复古计算、DOS等技术相关主题的语气。请贴出你的enter.bat的详细内容 |
|
| Floor9 badcfqtd | Posted 2005-09-05 17:14 |
| 中级用户 Posts 53 Credits 232 From 中国 | |
|
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 ] |
|
| Floor10 willsort | Posted 2005-09-06 19:31 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
Re All:
Let me first present my solution for question 1. Execute the following commands in sequence at the command line: [ Last edited by willsort on 2005-9-8 at 11:21 ] |
|
| Floor11 chenhui530 | Posted 2005-09-08 10:24 |
| 高级用户 Posts 273 Credits 772 | |
|
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 |
|
| Floor12 willsort | Posted 2005-09-08 11:31 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
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): ───────────────── 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 ] |
|
| Floor13 chujiafu | Posted 2005-09-10 06:42 |
| 银牌会员 Posts 595 Credits 1,339 From 安徽 宿州 | |
|
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 ] |
|
| Floor14 willsort | Posted 2005-09-10 10:14 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
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. |
|
| Floor15 willsort | Posted 2005-09-16 10:05 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
Re All:
Here is my solution for question 3: |
|
| 1 2 3 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |