Home > Software design >  Windows Batch file for copying not working
Windows Batch file for copying not working

Time:02-16

I am using batch commands to copy all the subfolders and all the files inside that subfolders to my USB drive but I am unable to copy anything . The only thing I am getting is the message on console screen which is 40 file(s)

The commands that I am using are written below :

@echo off
xcopy "C:\Users\Public\Tally.ERP9\Data" "G:\Data" /Y /F /l /s /E /t /H /i
pause >nul

I had tried searching google but unable to find a right solution . I request all the elite members of stackoverflow to please suggest a right solution . Sorry for my bad English . Thanks in advance .

CodePudding user response:

You are using parameter /T:

/T           Creates directory structure, but does not copy files.

Check xcopy /? to see what each parameter does and use only the ones that you need. You are also using /S and /E, which have the opposite effects.

CodePudding user response:

The /l switch shows the files that would be copied, but does not copy the files. Remove the /l and the copy should take place as was listed.

CodePudding user response:

Thanks respected members , With the suggestions given by you all , I have managed to copy the files by altering my previous command to following one below .

@echo off
xcopy "C:\Users\Public\Tally.ERP9\Data" "G:\Data" /Y /Q /S /E /H /I
pause >nul
  • Related