|
q1a2z3q1a2z3
初级用户
 
积分 88
发帖 41
注册 2006-5-13
状态 离线
|
『楼 主』:
合并文件夹的疑问?
使用 LLM 解释/回答一下
合并文件夹的疑问?
合并 D盘下 若干文件夹,因为文件夹的名字经常变动,所以感觉无从下手。
不知怎样把这些文件夹合并成一个文件夹。
Questions about merging folders?
I need to merge several folders under drive D, but the folder names change frequently, so I feel at a loss.
I don't know how to merge these folders into one folder.
|
|
2008-8-16 00:10 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
@echo off
set mypath=C:\test
if not exist "%mypath%\dstfolder" (
md "%mypath%\dstfolder"
)
for /f "tokens=*" %%a in ('dir /s /b /ad "%mypath%"') do (
if "%%a" neq "%mypath%\dstfolder" (
move /y %%a "%mypath%\dstfolder">nul 2>nul
)
)
```
@echo off
set mypath=C:\test
if not exist "%mypath%\dstfolder" (
md "%mypath%\dstfolder"
)
for /f "tokens=*" %%a in ('dir /s /b /ad "%mypath%"') do (
if "%%a" neq "%mypath%\dstfolder" (
move /y %%a "%mypath%\dstfolder">nul 2>nul
)
)
```
|

 |
|
2008-8-16 00:18 |
|
|
q1a2z3q1a2z3
初级用户
 
积分 88
发帖 41
注册 2006-5-13
状态 离线
|
|
2008-8-16 09:50 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
|
2008-8-16 11:53 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
@echo off
set mypath=E:
if not exist "%mypath%\合并" (
md "%mypath%\合并"
)
for /f "tokens=*" %%a in ('dir /s /b /ad "%mypath%"') do (
if "%%a" neq "%mypath%\合并" (
for /f "tokens=*" %%b in ('dir /s /b /a-d "%%a" 2^>nul') do (
if exist "%mypath%\合并\%%~nxb" (
ren "%mypath%\合并\%%~nxb" "%mypath%\合并\%%~nb.old">nul 2>nul
)
move "%%b" "%mypath%\合并">nul 2>nul
)
)
)
```batch
@echo off
set mypath=E:
if not exist "%mypath%\Merge" (
md "%mypath%\Merge"
)
for /f "tokens=*" %%a in ('dir /s /b /ad "%mypath%"') do (
if "%%a" neq "%mypath%\Merge" (
for /f "tokens=*" %%b in ('dir /s /b /a-d "%%a" 2^>nul') do (
if exist "%mypath%\Merge\%%~nxb" (
ren "%mypath%\Merge\%%~nxb" "%mypath%\Merge\%%~nb.old">nul 2>nul
)
move "%%b" "%mypath%\Merge">nul 2>nul
)
)
)
```
|

 |
|
2008-8-16 12:15 |
|
|
q1a2z3q1a2z3
初级用户
 
积分 88
发帖 41
注册 2006-5-13
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
亲爱的HAT!
对于你我已经无话可说了!太感动了。
一而再、再而三的帮助我这样一个批处理的弱者的,-^^-
一个重庆人,毫无利己的动机,把一个陌生人的bat当作他自己的事业,这是什么精神?这是国际主义的精神,这是共产主义的精神,每一个中国人都要学习这种精神。
再次感谢!
Dear HAT!
I have nothing more to say to you! So touched.
Helping a batch processing weakling like me again and again, -^^-
A native of Chongqing, with no self-interested motives, treating a stranger's bat as his own cause, what kind of spirit is this? This is the spirit of internationalism, this is the spirit of communism, and every Chinese should learn this spirit.
Thanks again!
|
|
2008-8-16 12:51 |
|
|
q1a2z3q1a2z3
初级用户
 
积分 88
发帖 41
注册 2006-5-13
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
同名文件,无法重命名?最后合并的文件夹只能保存一个文件。
Same-named files, unable to rename? The final merged folder can only save one file.
|
|
2008-8-16 14:54 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
Originally posted by q1a2z3q1a2z3 at 2008-8-16 12:51:
亲爱的HAT!
对于你我已经无话可说了!太感动了。
一而再、再而三的帮助我这样一个批处理的弱者的,-^^-
一个重庆人,毫无利己的动机,把一 ...
Orz
Originally posted by q1a2z3q1a2z3 at 2008-8-16 12:51:
Dear HAT!
There's nothing more I can say to you! So moved.
Helping me, a batch processing weakling, again and again, -^^-
A person from Chongqing, with no self-interested motives, to ...
Orz
|
|
2008-8-16 14:59 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 9 楼』:
Re 7楼
使用 LLM 解释/回答一下
@echo off
set mypath=E:
if not exist "%mypath%\合并" (
md "%mypath%\合并"
)
for /f "tokens=*" %%a in ('dir /s /b /ad "%mypath%"') do (
if "%%a" neq "%mypath%\合并" (
for /f "tokens=*" %%b in ('dir /s /b /a-d "%%a" 2^>nul') do (
if exist "%mypath%\合并\%%~nxb" (
ren "%mypath%\合并\%%~nxb" "%%~nb.old">nul 2>nul
)
move "%%b" "%mypath%\合并">nul 2>nul
)
)
)
```
@echo off
set mypath=E:
if not exist "%mypath%\Merge" (
md "%mypath%\Merge"
)
for /f "tokens=*" %%a in ('dir /s /b /ad "%mypath%"') do (
if "%%a" neq "%mypath%\Merge" (
for /f "tokens=*" %%b in ('dir /s /b /a-d "%%a" 2^>nul') do (
if exist "%mypath%\Merge\%%~nxb" (
ren "%mypath%\Merge\%%~nxb" "%%~nb.old">nul 2>nul
)
move "%%b" "%mypath%\Merge">nul 2>nul
)
)
)
```
|

 |
|
2008-8-16 19:13 |
|
|
BC
中级用户
  
积分 338
发帖 175
注册 2007-10-21
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
建议一下,能否以后在写的时候加上注解呢?
新手很难看地懂...
Suggestions, can you add annotations when writing in the future? Novices find it very hard to understand...
|

C:\
C:\Del BC |
|
2008-8-16 19:17 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
哪句不懂问哪句吧,写注释浪费时间。
完全不懂的话,先看看教程。
Just ask any question you don't understand, writing comments is a waste of time. If you don't understand at all, first look at the tutorial.
|

 |
|
2008-8-16 19:21 |
|
|
BC
中级用户
  
积分 338
发帖 175
注册 2007-10-21
状态 离线
|
|
2008-8-16 19:32 |
|
|
BC
中级用户
  
积分 338
发帖 175
注册 2007-10-21
状态 离线
|
|
2008-8-16 19:33 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 14 楼』:
Re 13楼
使用 LLM 解释/回答一下
for /?
In addition, substitution of FOR variable references has been enhanced.
You can now use the following optional syntax:
%~I - expands %I removing any surrounding quotes (")
%~fI - expands %I to a fully qualified path name
%~dI - expands %I to a drive letter only
%~pI - expands %I to a path only
%~nI - expands %I to a file name only
%~xI - expands %I to a file extension only
%~sI - expanded path contains short names only
%~aI - expands %I to file attributes of file
%~tI - expands %I to date/time of file
%~zI - expands %I to size of file
%~$PATH:I - searches the directories listed in the PATH
environment variable and expands %I to the
fully qualified name of the first one found.
If the environment variable name is not
defined or the file is not found by the
search, then this modifier expands to the
empty string
The modifiers can be combined to get compound results:
%~dpI - expands %I to a drive letter and path only
%~nxI - expands %I to a file name and extension only
%~fsI - expands %I to a full path name with short names only
%~dp$PATH:I - searches the directories listed in the PATH
environment variable for %I and expands to the
drive letter and path of the first one found.
%~ftzaI - expands %I to a DIR like output line
for /?
In addition, substitution of FOR variable references has been enhanced.
You can now use the following optional syntax:
%~I - expands %I removing any surrounding quotes (")
%~fI - expands %I to a fully qualified path name
%~dI - expands %I to a drive letter only
%~pI - expands %I to a path only
%~nI - expands %I to a file name only
%~xI - expands %I to a file extension only
%~sI - expanded path contains short names only
%~aI - expands %I to file attributes of file
%~tI - expands %I to date/time of file
%~zI - expands %I to size of file
%~$PATH:I - searches the directories listed in the PATH
environment variable and expands %I to the
fully qualified name of the first one found.
If the environment variable name is not
defined or the file is not found by the
search, then this modifier expands to the
empty string
The modifiers can be combined to get compound results:
%~dpI - expands %I to a drive letter and path only
%~nxI - expands %I to a file name and extension only
%~fsI - expands %I to a full path name with short names only
%~dp$PATH:I - searches the directories listed in the PATH
environment variable for %I and expands to the
drive letter and path of the first one found.
%~ftzaI - expands %I to a DIR like output line
|

 |
|
2008-8-16 19:54 |
|
|
BC
中级用户
  
积分 338
发帖 175
注册 2007-10-21
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
哦,原来这样,hat你的机是英文版?不错哦
Oh, so that's how it is. Is your computer in English version? Not bad oh
|

C:\
C:\Del BC |
|
2008-8-16 21:12 |
|