1

I want to copy a file from sharing folder to another using cmd command ".bat file" the below code works normally with most files except MS Access files the "accde" extension so, please advise.

MKDIR "\\192.168.0.110\Attendance Sheet\JTA\events\events_media\SysFile"

XCopy /y/z "\\192.168.0.110\Attendance Sheet\JTA\events\events_media\db.accde" 

"\\192.168.0.110\Attendance Sheet\JTA\events\events_media\SysFile"
6
  • What error(s) do you get for that type of file? Commented May 16, 2015 at 11:47
  • nothing the batch runs normally but the file won`t be copied Commented May 16, 2015 at 11:53
  • i don`t know is it a permission from the administrator or something wrong in the code ? ..... if it is permission how shall i override that ? Commented May 16, 2015 at 11:55
  • Why using xcopy for copying a single file and not copy? Do you have ever executed in a command prompt window xcopy /? and read help output by this command? For example if file db.accde has the hidden attribute set, you need the parameter /H. You should use a space between the options. Commented May 16, 2015 at 13:24
  • thanks /H works perfect but, the cmd window stays till the copy is done "the file has large size".... is there any way to hide it while coping the file Commented May 16, 2015 at 14:22

1 Answer 1

1

Run this code to have the command execute in the background so that you can continue to work from the command line while it is running:

start /min xcopy /y /z "sourcefile" "destination"  

Actually, the command is running in a minimized window of it's own - you can see it popping up in the taskbar. But from a user's perspective it's the same as running "in the background".

Sign up to request clarification or add additional context in comments.

2 Comments

i will try it but, i have another question: i try "/D:m-d-y" but, doesnt work i dont want to copy the file every time i just want to copy it if there any modification done on it ...how shall i use it ?
Use the /M option with xcopy which looks at the 'modified' flag. Only if the file has been modified since last copied it will be copied and the 'archive' flag will be reset. You need some permissions on the source files to reset the flag, though. But you could get rid of the date selection ('/D').

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.