MilesLogan
asked on
Copy file from multiple shares to one location
Does anyone have a script to share that will do something like this ?
I need to copy the same file from multiple shares to one location .. I can copy the file and rename it , but this is on 100s of shares and I dont have the knowledge to do it in a mass scale .
basically I need the script to look on a text file for the path to the shares and copy logfile.log to one location . Issue is that since the file is the same , I need it to be renamed when copied so its not over ridden . I dont care about the file name that its copied to .. a number at the end will work .
I need to copy the same file from multiple shares to one location .. I can copy the file and rename it , but this is on 100s of shares and I dont have the knowledge to do it in a mass scale .
basically I need the script to look on a text file for the path to the shares and copy logfile.log to one location . Issue is that since the file is the same , I need it to be renamed when copied so its not over ridden . I dont care about the file name that its copied to .. a number at the end will work .
ASKER
Hi oBdA
This works great only , issue I ran into is if there is two shares with the same path , it will only copy one file.
This works:
\\Share\folder\User1
\\Share\folder99\User2
This does not:
\\Share\folder\User1
\\Share\folder\User2
would it be too much for you to modify so the output is the samaccountname ? if I have the input file be ..
Column A , Column B
SamAccountName,Path
Outputfile wold be the SamAccountName for each file .. if that is too much, no worries .. I can deal with the file names as is ..
If you can get past this ..
This does not:
\\Share\folder\User1\LogFi le.log
\\Share\folder\User2\LogFi le.log
This works great only , issue I ran into is if there is two shares with the same path , it will only copy one file.
This works:
\\Share\folder\User1
\\Share\folder99\User2
This does not:
\\Share\folder\User1
\\Share\folder\User2
would it be too much for you to modify so the output is the samaccountname ? if I have the input file be ..
Column A , Column B
SamAccountName,Path
Outputfile wold be the SamAccountName for each file .. if that is too much, no worries .. I can deal with the file names as is ..
If you can get past this ..
This does not:
\\Share\folder\User1\LogFi
\\Share\folder\User2\LogFi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes , that is correct .. same pattern
ASKER
Thank you so much oBdA.. Happy Holidays !
Open in new window