0

I am trying to gather files/folders from multiple computers in my network into one centralized folder in the command console (this is the name of the pseudo server for this set of computers)

Basically, what i need is to collect a certain file from all the computers connected to my network and back it up in the console.

Example: * data.txt // this is the file that i need to back up and its located in all the computers in the same location * \console\users\administrator\desktop\backup\%computername% // i need each computer to create a folder with its computer name into the command console's desktop so i can keep track of which files belongs to which computer

I was trying to use psexec to do this using the following code:

psexec @cart.txt -u administrator -p <password> cmd /c (^net use \\console /USER:administrator <password> ^& mkdir \\console\users\Administrator\Desktop\backup\%computername% ^& copy c:\data.txt \\console\USERS\Administrator\DESKTOP\backup\%computername%\)

any other suggestions since im having trouble with this command

1 Answers1

1

Just use the command copy must easy.

take a look:

for /F %%a in (computerslist.txt) do (
copy \\%%a\c$\users\administrator\desktop\%%a\*.txt c:\mycollecteddata\%%a
)

that will copy all files *.txt for all computers that are on computereslist.txt; the copy will be with the current credentials. Save the code on a file *.cmd and execute with the right user, you can create a scheduled taks to start with a user thant is commom for all computers.

Good work.

MineScript
  • 291
  • 1
  • 4