|
beyoungse
中级用户
  
积分 253
发帖 112
注册 2005-12-20
状态 离线
|
『楼 主』:
把一个文件拷贝到很多的文件夹(规律)
使用 LLM 解释/回答一下
把bak这个文件夹拷贝到如 a001 a002 ……a009……a010……a100文件夹中
Copy the bak folder to folders such as a001, a002, ……, a009, ……, a010, ……, a100
|
|
2007-1-4 00:52 |
|
|
beyoungse
中级用户
  
积分 253
发帖 112
注册 2005-12-20
状态 离线
|
|
2007-1-4 00:52 |
|
|
namejm
荣誉版主
       batch fan
积分 5226
发帖 1737
注册 2006-3-10 来自 成都
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
@echo off
for /l %%i in (1,1,100) do call :copy_ %%i
goto :eof
:copy_
set num=00%1
set name=a%num:~-3%
copy bak %name%
goto :eof
```
@echo off
for /l %%i in (1,1,100) do call :copy_ %%i
goto :eof
:copy_
set num=00%1
set name=a%num:~-3%
copy bak %name%
goto :eof
```
|

尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。 |
|
2007-1-4 00:57 |
|
|
flamey
初级用户
 
积分 152
发帖 74
注册 2005-12-1
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
楼上的批处理中copy bak %name%这行有点问题,如果我这个目录本来没有这些文件夹的时候就会出错!
There is a problem with the line "copy bak %name%" in the batch file upstairs. If there are no such folders in this directory originally, it will go wrong!
|
|
2007-1-4 04:08 |
|
|
namejm
荣誉版主
       batch fan
积分 5226
发帖 1737
注册 2006-3-10 来自 成都
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
楼主并没有特别说明这些文件夹是否存在,按照一般的理解,默认是存在的;如果不存在,那只能怪楼主交代不清;对于模糊不清的问题,无论是谁,都不可能解决得尽善尽美。
The owner of the post did not specifically state whether these folders exist. According to the general understanding, they are default to exist; if they do not exist, then it can only be blamed on the owner of the post for not making it clear; for ambiguous questions, no one, no matter who, can solve them perfectly.
|

尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。 |
|
2007-1-4 04:16 |
|
|
beyoungse
中级用户
  
积分 253
发帖 112
注册 2005-12-20
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
不好意思,我是新人,在实际的应用上想省点事情,就来请教大侠,
我问题时没有考虑太多,不好意思
I'm sorry, I'm a newbie. I want to save some trouble in actual application, so I come to ask the experts.
I didn't think too much about my question, sorry
|
|
2007-1-4 23:56 |
|
|
beyoungse
中级用户
  
积分 253
发帖 112
注册 2005-12-20
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
@echo off
for /l %%i in (1,1,100) do call :copy_ %%i
goto :eof
:copy_
set num=00%1
set name=a%num:~-3%
copy bak %name%
goto :eof
我试过了,可是目标都成了文件,而不是文件夹
我的目的是把BAK这个文件夹拷贝到已经存在的文件夹中(a001,a002 ……a100这些目录是已经存在的文件夹)
```batch
@echo off
for /l %%i in (1,1,100) do call :copy_ %%i
goto :eof
:copy_
set num=00%1
set name=a%num:~-3%
xcopy bak "%name%" /e /i
goto :eof
```
我试过了,可是目标都成了文件,而不是文件夹
我的目的是把BAK这个文件夹拷贝到已经存在的文件夹中(a001,a002 ……a100这些目录是已经存在的文件夹)
|
|
2007-1-5 00:09 |
|
|
namejm
荣誉版主
       batch fan
积分 5226
发帖 1737
注册 2006-3-10 来自 成都
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
呵呵,没仔细看题目,以为bak是文件,失误。复制文件夹应该把 copy 换成 xcopy,再加上适当的参数。
Hehe, didn't read the question carefully, thought bak was a file, made a mistake. To copy a folder, you should replace copy with xcopy and add appropriate parameters.
|

尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。 |
|
2007-1-5 01:49 |
|
|
beyoungse
中级用户
  
积分 253
发帖 112
注册 2005-12-20
状态 离线
|
『第 9 楼』:
再问题 拷贝 Documents and Settings 文件夹
使用 LLM 解释/回答一下
把 Documents and Settings 这个文件来 拷贝到A001,A002,A003……A110文件夹中
Last edited by beyoungse on 2007-1-7 at 12:33 PM ]
Copy the "Documents and Settings" file to the folders A001, A002, A003...A110 folders
Last edited by beyoungse on 2007-1-7 at 12:33 PM ]
|
|
2007-1-5 04:35 |
|
|
beyoungse
中级用户
  
积分 253
发帖 112
注册 2005-12-20
状态 离线
|
『第 10 楼』:
我拷贝不了
使用 LLM 解释/回答一下
把 Documents and Settings 这个文件来 拷贝到A001,A002,A003……A110文件夹中
Copy the "Documents and Settings" file to the folders A001, A002, A003……A110Folder
|
|
2007-1-7 12:35 |
|
|
dikex
高级用户
    潜水修练批处理
积分 788
发帖 366
注册 2006-12-31
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
Documents and Settings\%username%\文件夹里面的NTUSER和NTUSER.DAT文件是注册表相关的文件,正常情况下是无法复制的
The NTUSER and NTUSER.DAT files in the Documents and Settings\%username%\ folder are registry - related files, and they cannot be normally copied.
|
|
2007-1-7 12:48 |
|
|
beyoungse
中级用户
  
积分 253
发帖 112
注册 2005-12-20
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
这个文件夹是我自己建立的,里面只存在我自己建立的几个文件
老大帮帮我
This folder was created by myself, and it only contains a few files created by myself. Boss, help me.
|
|
2007-1-7 12:55 |
|
|
beyoungse
中级用户
  
积分 253
发帖 112
注册 2005-12-20
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
我的目的是把用户桌面放在一个文件服务器上的,用户的系统是只读的
My purpose is to place the user's desktop on a file server, and the user's system is read-only
|
|
2007-1-7 12:56 |
|
|
dikex
高级用户
    潜水修练批处理
积分 788
发帖 366
注册 2006-12-31
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
复制时用""括住路径即可正常复制
Just enclose the path with "" when copying, and it can be copied normally
|
|
2007-1-7 13:02 |
|
|
beyoungse
中级用户
  
积分 253
发帖 112
注册 2005-12-20
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
你能不能帮我写一下呢,是在当前目录操作,不用写路径吧?
我用上面的批处理,
@echo off
for /l %%i in (1,1,100) do call :copy_ %%i
goto :eof
:copy_
set num=00%1
set name=a%num:~-3%
copy Documents and Settings %name%
goto :eof
Can you help write it? Operating in the current directory, no need to write the path, right?
I used the above batch processing,
@echo off
for /l %%i in (1,1,100) do call :copy_ %%i
goto :eof
:copy_
set num=00%1
set name=a%num:~-3%
copy Documents and Settings %name%
goto :eof
|
|
2007-1-7 13:10 |
|