开发者

Copy updated files from 1 PC to it's networked clients

开发者 https://www.devze.com 2023-04-03 08:33 出处:网络
The scenario - 9 PCs on a LAN, 1 Instructor system and 8 Clients, all with static IPs. Files within a directory on the instructor system could be updated at any time and I\'d like to launch a script

The scenario - 9 PCs on a LAN, 1 Instructor system and 8 Clients, all with static IPs. Files within a directory on the instructor system could be updated at any time and I'd like to launch a script which would connect to the client PCs, lookup that set directory and copy across the files to ensure they're up to date. This would also require to kill an .exe to ensure that things worked correctly. Then if possible, restart that app.

I'd like this to run from a simple script ideally, so from what I've seen VBS or perhaps a batch file would be best. But I'm open to suggestions. Thanks.

Update. I'm trying to run PsExec to launch a VBS script on each clie开发者_StackOverflownt: start PsExec.exe @addresses.txt -u [username] -p [password] -i 2 c:\scripts\killTask.vbs

Then I've set up Microsoft SyncToy, followed by PsExec again to launch the required program. But PsExec is returning Unknown user/bad password errors. Is there a common problem/fix to PsExec connecting to XP machines?


This should be fairly simple with a batch file.

I would look at system internals pskill and psexec to stop and start the processes. To do the copying I'd use xcopy /D which will copy files if the source date is newer. Set an environment variable to contain the list of client PCs, then use a for loop to do call a routine for each of them that does the pskill, xcopy, psexec.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号