|
fan927
初级用户
 
积分 82
发帖 31
注册 2006-5-23
状态 离线
|
『楼 主』:
关于批处理中远程copy的问题
使用 LLM 解释/回答一下
我公司70多台电脑,最近饱受arp欺骗类软件折磨,我做了个ip和mac绑定的批处理(静态mac自动绑定.bat),已在网关处做了绑定,现在我想另外做个批处理,将(静态mac自动绑定.bat),远程copy到所以客户机的启动目录下,所有客户机的管理员密码我都知道,但是远程copy时候,用批处理只能copy到c:
net use \\192.168.0.50 /user:administrator 123456
copy 静态mac自动绑定.bat \\192.168.0.50\ c$
当运行
copy 静态mac自动绑定.bat \\192.168.0.50 \%ALLUSERSPROFILE%\「开始」菜单\程序\启动
它会报错,"命令语法不正确",请教各位高手,这个批处理要怎么写?多谢各位了.
Our company has more than 70 computers and has recently been tortured by ARP spoofing - type software. I made a batch script for IP and MAC binding ("Static MAC Automatic Binding.bat"). I have done the binding at the gateway. Now I want to make another batch script to remotely copy the "Static MAC Automatic Binding.bat" to the startup directory of all client computers. I know the administrator passwords of all client computers, but when copying remotely, I can only copy it to C: using the batch script.
net use \\192.168.0.50 /user:administrator 123456
copy 静态mac自动绑定.bat \\192.168.0.50\ c$
When running
copy 静态mac自动绑定.bat \\192.168.0.50 \%ALLUSERSPROFILE%\「开始」菜单\程序\启动
It will report an error, "The command syntax is incorrect". Asking all the experts, how should this batch script be written? Thank you all.
|
|
2006-5-26 06:34 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
后一种拷贝方法有两个问题:
1、%ALLUSERPROFILE%是本地的环境变量,未必适用于对方机器。
2、命令应该这样写(将目标路径用双引号括起来,因为路径中有空格):
copy 静态mac自动绑定.bat "\\192.168.0.50 \%ALLUSERSPROFILE%\「开始」菜单\程序\启动"
更好的解决办法应该是在网上建立Active Directory,然后通过域登录脚本之类的方法来实现批处理文件的自动运行,通过域控制器可以集中控制的。
There are two problems with the latter copying method:
1. %ALLUSERPROFILE% is a local environment variable, which may not be applicable to the other party's machine.
2. The command should be written like this (enclose the target path in double quotes because there are spaces in the path):
copy 静态mac自动绑定.bat "\\192.168.0.50 \%ALLUSERSPROFILE%\「Start」Menu\Programs\Startup"
A better solution should be to set up an Active Directory on the network, and then use methods such as domain login scripts to realize the automatic operation of batch files. It can be centrally controlled through the domain controller.
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2006-5-26 10:46 |
|
|
fan927
初级用户
 
积分 82
发帖 31
注册 2006-5-23
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
建域可是大工程,不太现实,多谢Climbing兄回帖.
我想到用at,好像可以实现,一些木马就是这个原理吧,就是比较复杂,不过也比70多台机挨个装来的快.
Building a domain is a big project, not very realistic. Thanks for the reply from Brother Climbing.
I thought of using at, it seems it can be implemented. Some trojans work on this principle. It's just relatively complex, but it's faster than installing on more than 70 machines one by one.
|
|
2006-5-26 14:07 |
|
|
bagpipe
银牌会员
     DOS联盟捡破烂的
积分 1144
发帖 425
注册 2005-10-20 来自 北京
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
同意Climbing兄的说话,如果是网吧的机器那就算了,如果是公司的,70多台应该建立一个域控制器才是,管理方便,容易使用,权限也很好设置,方便很多了.......
Agree with what Brother Climbing said. If it's an internet café machine, then it's okay. But if it's a company's, with more than 70 machines, a domain controller should be set up. It's convenient for management, easy to use, permissions are easy to set, and it's much more convenient...
|
|
2006-5-26 15:34 |
|
|