China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-01 18:19
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » [Discussion] Directly moving directories in MSDOS View 1,467 Replies 12
Original Poster Posted 2006-04-07 13:47 ·  中国 山西 太原 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline

───────────────── Moderator Record ─────────────────
Executed by: Will Sort
Action: split thread: 《19952 - How do you rename a non-empty folder under DOS?》
Note: the discussion content and direction within the thread diverged significantly
───────────────── Moderator Record ─────────────────


I noticed long ago that the MOVE in MSDOS and Win9x seems a bit “off-task.” Its handling of directories can only be understood as renaming, while to move a directory you have to specify the files inside it and move them all together. But in reality, moving a directory is still essentially just a change to the file directory table; for example, MOVE in CMD can directly move it. I wonder whether you can clear up this confusion for me, and perhaps provide a command-line tool that can directly move directories under DOS.

[ Last edited by willsort on 2006-4-8 at 23:13 ]
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 2 Posted 2006-04-07 14:09 ·  中国 上海 黄浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
Reply to 笑天:

I can understand what you mean, but if you're trying to save effort, why insist on moving it directly?
The limitation of traditional DOS MOVE is that it can only handle directories at the same level. If the move is between different levels or across different drives, then it can only operate on files. But 4DOS can perform any of the above operations, and it can do so with subdirectories included.
Floor 3 Posted 2006-04-08 02:49 ·  加拿大 Bell
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
willsort:

As I recall, the MOVE command in a Win9x DOS window actually can directly move directories, although under pure DOS it can only rename directories.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 4 Posted 2006-04-08 14:08 ·  中国 山西 临汾 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re Wengier:

This really was a mistake in my memory, so I correct it here and apologize: Win98's MOVE indeed can directly move folders.

Re DOSforever:

I tested with 4dos7.50 under msdos7.10, and found that its move still moves the files inside the directory. For example, it cannot pass the following test:

md src
md dst
move src dst

As for move between different drives, that's another matter. Even under XP it is still a copy-plus-delete operation.
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 5 Posted 2006-04-08 17:56 ·  中国 上海 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
Reply to 笑天:

Oh, now I understand what you mean. You want move to work like NC's F6(rename/move) function, so that operations on directories are just like operations on files. Right? From your example, you want to move src under the dst directory so that it becomes a subdirectory under dst, right? You can do it like this:
move /d src dst
Just answer y.
Floor 6 Posted 2006-04-08 22:37 ·  中国 山西 大同 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re DOSforever:

I just tested move /d src dst, and it still reports File not found "c:\test\src\*.*" . The same happens with move@4dos under both MSDOS6.22 and Win98Se. Also, 4dos seems not to recognize the msdos7.10 version, and therefore limits part of its functionality, such as the command-line documentation for commands.
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 7 Posted 2006-04-08 22:47 ·  中国 上海 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
Hehe, it really does say "File not found", but you can go in and take a look: the src subdirectory is already under dst. The reason it reports "File not found" is that your src directory was empty to begin with, so move thinks there are no files to move.

Also, I'm not sure what you mean by “the command-line documentation for commands”; what functionality is missing?
Floor 8 Posted 2006-04-08 23:04 ·  中国 山西 大同 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re DOSforever:

I did not observe any visible changes in src or dst. And even if src has indeed been moved into the dst directory, File not found still shows that 4dos intends to move the files inside the directory. But that is unnecessary: moving a directory only requires changing the directory's own FDT, and should not require changing the FDTs of the files and subdirectories under it.

By command-line documentation I mean the help information for 4dos commands. For example, the results of move /? under msdos7.10/NTs and under msdos6.xx/win9x are different; I have not observed the other limitations, so I can't be sure, but judging from 4dos's installation prompt under NTs, there do seem to be certain functional restrictions.
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 9 Posted 2006-04-09 02:02 ·  加拿大 Bell
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
willsort:

I tried the full 4DOS 7.50 version downloaded from the JPSoft website (now free to download, no registration required) under MS-DOS 6.0/MS-DOS 7.1/Win98SE/WinXP, and found that whether I extracted it directly for use under MS-DOS 6.0/MS-DOS 7.1/WinXP, or installed it under Win98SE and then used it, running MOVE /? showed no differences at all; in every case it displayed the help information. So it seems there is no such functional restriction. If there is any difference, it may be related to other configuration factors.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 10 Posted 2006-04-09 14:28 ·  中国 湖南 常德 电信
银牌会员
★★★
Credits 1,384
Posts 709
Joined 2005-10-29 22:22
20-year member
UID 44271
Status Offline
4dos of course recognizes dos710, but the OP's question was also something that confused me for a long time. Later I got too lazy to keep digging into it, so I just used nc.
Floor 11 Posted 2006-04-09 18:38 ·  中国 山西 运城 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re Wengier:

It has now been confirmed that when running 4dos.com, if it does not have support from 4dos.hlp, then when using command lines like move /?, it will be unable to display the help documentation. Therefore, there is no compatibility problem between 4DOS and MSDOS7.10.

In addition, after transplanting the Win98 MOVE for use under MSDOS7.10, the result was still that it could not directly move directories; the same was true in Win98 real DOS mode. Based on this, I infer that direct directory moving is evidently supported by Windows.
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 12 Posted 2006-04-10 23:13 ·  中国 上海 闵行区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
???
I'm getting a bit confused reading this. Maybe I haven't understood exactly what you mean by “directly.” At first I understood it as you possibly meaning the physical movement of files. That's why I said, “if you're trying to save effort, why move directly?” Now it seems you mean that the move command should “directly” take the directory itself as the object of operation, rather than the files inside the directory. Just like NC's F6 function I mentioned earlier. If that's what you mean, then I don't think there's much to discuss, because under traditional DOS, move simply has this characteristic. In fact, this characteristic was inherited from the traditional behavior of DOS command operation objects: that is, if a filename is assumed to be a file, then the operation is performed on that file; if it is a directory, then the operation is performed on the files inside that directory. dir, del, and copy are all like this. I think both you and I understand that point. When DOS originally added the move command, it likewise had to preserve this characteristic, so there was no such “direct” behavior as you imagine. (Actually, when we first started using the move command, we all made this same taken-for-granted mistake: strange, why can't move move directories? And even when it does, it can only do so between the same level—what kind of move is that, isn't that just ren? Hehe.) Actually, your current confusion (in my opinion) is because you've used Windows for so long that you've unconsciously been too deeply “poisoned” by it. You've reversed some Windows operating habits back onto DOS. (Hehe, actually I also feel that after using Windows too long, my brain has gotten duller.)

There is one point I left out earlier; it should be this:
move /d src dst\src
This way it can create the src subdirectory under dst, but the source src directory still remains, and the reason is still the DOS operation-object characteristic I mentioned above.

provide a command-line tool that can directly move directories under DOS.

I'm afraid probably not. Because everyone wants to preserve this DOS operating characteristic, unless someone now sees your idea, 笑天, and redevelops one


4DOS.COM really does give different help prompts in different environments, but this does not refer to the separate help prompt for each individual command; rather it refers to the “question mark” help prompt, that is "?", similar to FASTHELP in MS-DOS. Under a pure DOS environment, compared with MS-DOS 7.X and the DOSBOX under Win9x, it lacks the two commands lock and unlock.

but judging from 4dos's installation prompt under NTs, there do seem to be certain functional restrictions.

I have never installed/used 4DOS in an NTs environment. It seems that from your practical testing, my guess has been confirmed.
http://www.cn-dos.net/forum/viewthread.php?tid=15228&page=1
a passage in my post #10 there
Floor 13 Posted 2007-10-04 00:46 ·  中国 湖北 潜江 电信
高级用户
★★★
Credits 894
Posts 411
Joined 2007-02-17 12:15
19-year member
UID 79697
Gender Male
Status Offline
Asking this shows ignorance; then just use "Cut".
@set c= 不知则觉多,知则觉少,越知越多,便觉越来越少. --- 知多少.
@for,/l,%%i,in,(1,1,55)do,@call,set/p=%%c:~%%i,1%%<nul&ping/n 1 127.1>nul


Forum Jump: