|
xhf618
新手上路

积分 12
发帖 4
注册 2006-9-26
状态 离线
|
『楼 主』:
求助:在cmd下可以运行的语句为啥在批处理就不行了呢?
使用 LLM 解释/回答一下
老总要求定时把设计部所有机子的设计方案备份到服务器,在一个帖子找到这个命令可用:
for /r c:\ %a in (*.cdr) do @copy "%a" d:\
我的做法是先在服务器上映射每台机的磁盘,再用上面的命令搜索cdr文件复制到服务器.可是我测试的时候,发现在cmd下这个语句可以运行,但作成批处理文件运行时就只是一闪而过,没有作用,请帮忙,先谢了.
另外,这个命令运行时,能否加入一个功能,就是遇到同名文件时自动覆盖,因为每天都要自动备份,肯定会有重复要覆盖的.先多谢各位的帮忙了.
The boss requires regularly backing up the design schemes of all computers in the design department to the server. I found this command available in a post:
for /r c:\ %a in (*.cdr) do @copy "%a" d:\
My approach is to first map the disk of each computer on the server, and then use the above command to search for cdr files and copy them to the server. But when I tested, I found that this statement can run in cmd, but when made into a batch file and run, it just flashes by and has no effect. Please help, thanks in advance.
In addition, when this command runs, can it add a function to automatically overwrite when encountering files with the same name? Because it needs to be backed up automatically every day, there will definitely be duplicates to overwrite. Thanks a lot for everyone's help.
|
|
2006-9-27 01:31 |
|
|
amao
中级用户
  
积分 316
发帖 152
注册 2006-6-18
状态 离线
|
|
2006-9-27 01:58 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
同意楼上的说法~
Agree with the statement above.
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-9-27 02:11 |
|
|
xhf618
新手上路

积分 12
发帖 4
注册 2006-9-26
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
还是没用啊,一闪就过了,服务器是2003系统
Still no good, it flashes by. The server is a 2003 system
|
|
2006-9-27 02:15 |
|
|
xhf618
新手上路

积分 12
发帖 4
注册 2006-9-26
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
哦,行了,不好意思,漏了一个,有两个%a的.
Oh, alright, sorry, I missed one, there are two %a's.
|
|
2006-9-27 02:19 |
|
|
xhf618
新手上路

积分 12
发帖 4
注册 2006-9-26
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
那,能做到让它自动覆盖同名文件吗?
Well, can it be made to automatically overwrite files with the same name?
|
|
2006-9-27 02:20 |
|
|
NaturalJ0
银牌会员
    
积分 1181
发帖 533
注册 2006-8-14
状态 离线
|
|
2006-9-27 04:03 |
|
|
hymm2008
初级用户
 
积分 102
发帖 43
注册 2006-9-7
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
可以 用 Replace 命令試試
You can try using the Replace command
|
|
2006-9-28 21:15 |
|
|
cxmzlxb
新手上路

积分 17
发帖 13
注册 2006-9-6
状态 离线
|
|
2006-10-2 21:29 |
|
|
qq82015930
中级用户
  
积分 235
发帖 109
注册 2006-8-24
状态 离线
|
|
2006-10-13 07:18 |
|