Follow dba-ninja.com

Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions

dba-ninja.com Links

Dba_db2_button

Sqlserver_dba_button

How do I copy a file to a folder in cmd?

19 August,2024 by Rambler

Question:    Could you supply the command for connecting to a folder on another Windows server? I need to create a connection to another folder share and then copy a file. The administrator has supplied me with  user name & password 

Answer: I'm assuming you have the folder share available .

From your requesting server. Note: I've select M:\  - customise according to the server reqs

--command to make connection

net use M: \\myserver.com\myfoldershare /USER:domain\myuser "my_password"
The command completed successfully.

change directory to M:\

--copy file 

M:\ copy c:\temp\myfile.txt 

--check to see if file is there

dir 

 

Some alternative methods using Powershell

How to force a powershell copy-item file copy

Powershell find command and copy a file

Compare-Object Powershell to validate a folder copy

 

 

 

 

 

 

 


Author: Rambler (http://www.dba-ninja.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on How do I copy a file to a folder in cmd?


dba-ninja.com