Jump to content

Command Line script for coping files.


Recommended Posts

Posted

Hi Masters,

 

Can someone please help me out?

I want a script which can copy some zip files from one server to another server. Need for windows 2003 servers.

 

For eg:

 

From \\server1\share1 to \\server2\c$\temp

 

Note: We have to specify file names which needs to be copied. Installable.zip, software.zip, plugins.zip, hotfix.zip .... etc.

 

 

Thanks in Advance!:)

Posted

Hi would this script help?

 

Its a Powershell Script for copying files from a source to a destination and forcing folder creation if it does not exist at the destination, see below:

 

$targetdirectory = "D:\To"

$sourcedirectory = "\\server\from"

 

if (!(Test-Path -path $targetdirectory)) {New-Item $targetdirectory -Type Directory}

Copy-Item -Path $sourcedirectory\file.zip -Destination $targetdirectory

Posted
This will not work on Win 2003 server.

 

If you're referring to Robocopy not working, you are mistaken. I've been using it on Windows platforms since 1999...

Posted
I want to copy multiple files can you provide me syntax for xcopy.

Click the XCopy link I posted above (or run XCopy /? from the Command Prompt) to view the syntax.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...