LuckyLucks
asked on
Copying file from one server to another
Hi,
I have the names of file path in a MS SQL 2005 table in the following format:
Path Filename
Myfileserver\ABC abc.txt
Myfileserver\DBC dbc1.txt
etc
These can be dumped into a flat file called processfiles.txt residing on the SQL server, which would contain the following contents:
Myfileserver\ABC\abc.txt
Myfileserver\DBC\dbc1.txt
I wanted to write a batch script that will reside on a different server than the SQL server and will need to copy those files in the table and put them on a folder on the current server.
How do I accomplish this?
I have the names of file path in a MS SQL 2005 table in the following format:
Path Filename
Myfileserver\ABC abc.txt
Myfileserver\DBC dbc1.txt
etc
These can be dumped into a flat file called processfiles.txt residing on the SQL server, which would contain the following contents:
Myfileserver\ABC\abc.txt
Myfileserver\DBC\dbc1.txt
I wanted to write a batch script that will reside on a different server than the SQL server and will need to copy those files in the table and put them on a folder on the current server.
How do I accomplish this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The problem is Myfileserver\ABC and Myfileserver\DBC etc are dynamically produced in the table. So prior to this question, there is a button thats presses, stuff happens and the table containing the two folder locations is created. It could be a different number and name of folders the next time around. Each folder also may have a different number of files in it each time. Hence, any hardcoding is not going to work.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do the original files have to be deleted?
ASKER
no originals have to be deleted
@LuckyLucas - any response to my previous post?
for %%f in (Myfileserver\abc\*.txt) DO type %%f>>\\Otherfileserver\wha
do this for each folder