China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 16:51
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Regarding the issue of remote copy in batch processing View 1,640 Replies 3
Original Poster Posted 2006-05-26 06:34 ·  中国 广东 深圳 福田区 电信
初级用户
Credits 82
Posts 31
Joined 2006-05-23 00:33
20-year member
UID 55824
Status Offline
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.
Floor 2 Posted 2006-05-26 10:46 ·  中国 浙江 杭州 电信
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
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.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 3 Posted 2006-05-26 14:07 ·  中国 广东 深圳 福田区 电信
初级用户
Credits 82
Posts 31
Joined 2006-05-23 00:33
20-year member
UID 55824
Status Offline
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.
Floor 4 Posted 2006-05-26 15:34 ·  中国 北京 联通
银牌会员
★★★
DOS联盟捡破烂的
Credits 1,144
Posts 425
Joined 2005-10-20 00:00
20-year member
UID 43784
From 北京
Status Offline
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...
Forum Jump: