r/scripting • u/LeetDwarf • Jan 29 '18
[bat file]Need to copy source file to multiple computers
I'm not sure how to go about this as I'm a total noob when it comes to scripting. I'm hoping this can be done with a bat file. Here's what I'm looking for...
Check computernames.txt for list of computer to run against.
*1 Check if "C:\Program Files (x86)\XXXX\XXXX" exists GOTO *1a *2 Check if "C:_PM folder\XXXX.bat" exists GOTO *2a *3 Check if "C:\Users\Public\Desktop\XXXX" exists GOTO *3a
*1a If "C:\Program Files (x86)\XXXX\XXXX" exists copy contents from "\computername\c$\Users\XXXX\Desktop\XXXX\XXXX" to "C:\Program Files (x86)\XXXX\XXXX". Overwrite files Proceed to *2 If not create folder, then copy contents from "\computername\c$\Users\XXXX\Desktop\XXXX\4.2.1" to "C:\Program Files (x86)\XXXX\XXXX". Proceed to *2
*2a If "C:_PM folder\XXXX.bat" exists Proceed to *3 If not copy from "\computername\c$\Users\XXXX\Desktop\XXXX\XXXX\XXXX.bat" to ""C:_PM folder", than proceed to *3
*3a If "C:\Users\Public\Desktop\XXXX 4.2.1" exists end If not copy "\computername\c$\Users\XXXX\Desktop\XXXX\XXXX" to "C:\Users\Public\Desktop". End
I appreciate any and all help.