中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-23 18:05
47,812 topics / 349,917 posts / today 0 new / 48,274 members
DOS批处理 & 脚本技术(批处理室) » Regarding the issue of remote copy in batch processing
Printable Version  1,777 / 3
Floor1 fan927 Posted 2006-05-26 06:34
初级用户 Posts 31 Credits 82
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.
Floor2 Climbing Posted 2006-05-26 10:46
铂金会员 Posts 2,753 Credits 6,962 From 河北保定
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.
Floor3 fan927 Posted 2006-05-26 14:07
初级用户 Posts 31 Credits 82
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.
Floor4 bagpipe Posted 2006-05-26 15:34
银牌会员 Posts 425 Credits 1,144 From 北京
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...
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023