We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,659 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How to transfer the files from the server to the client machine using batch script ?

Hi,
Any one please help me out.

Server: In Windows 2008, am having the database file (*.bak ) in the following locations

[B]C:\program files\Microsoft Sql server\backup\test.bak[/B]

I needs to copy, the test.bak file in my local machine (windows xp) in the following path

C:\backup

Using batch script, i needs to complete this task and then i needs to schedule it out. please solve my issue. Thanks

2
Contributors
6
Replies
2 Days
Discussion Span
1 Year Ago
Last Updated
7
Views
Question
Answered
jacksantho
Junior Poster
169 posts since Feb 2011
Reputation Points: 7
Solved Threads: 0
Skill Endorsements: 0

Hello,

This should work provided you have access to the file and directory listed:

copy "\\ServerNameOrIP\c$\Program Files\Microsoft Sql server\backup\test.bak" C:\backup\
rch1231
Veteran Poster
1,040 posts since Sep 2009
Reputation Points: 142
Solved Threads: 154
Skill Endorsements: 12

Hi,
Thanks for your script.From where,i should run this?In the sense, i should run in the CLIENT MACHINE(destination(client window)machine from the server window machine) using DOS command.

jacksantho
Junior Poster
169 posts since Feb 2011
Reputation Points: 7
Solved Threads: 0
Skill Endorsements: 0

Hi,

what do you meant by this line?
This should work provided you have access to the file and directory listed:

jacksantho
Junior Poster
169 posts since Feb 2011
Reputation Points: 7
Solved Threads: 0
Skill Endorsements: 0

Hi,
thanks its working, but while doing copying i needs to append CURRENT DATE over the file.

I tries this, is not working:

[B]set folderdate=%date:~0,4%-%date:~5,2%-%date:~8,2%
COPY "\\server\c$\DB.bak" C:\temp\DB.bak%folderdate%[/B]

please solve this issue thanks.

jacksantho
Junior Poster
169 posts since Feb 2011
Reputation Points: 7
Solved Threads: 0
Skill Endorsements: 0

Hello,

I cheated and used the following app in windows or dos based systems:
http://www.informatics-consulting.ch/software/namedate.htm

rch1231
Veteran Poster
1,040 posts since Sep 2009
Reputation Points: 142
Solved Threads: 154
Skill Endorsements: 12

Hello,
am not get you. First, am running this script in dos command and then making as a batch file and keep doing scheduling.

my system date format is it like 3/8/2012

While on doing copying, i needs to appending current system date towards the file. plz

jacksantho
Junior Poster
169 posts since Feb 2011
Reputation Points: 7
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 1 Year Ago by rch1231

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0932 seconds using 2.68MB