0

I am trying to copy files from a path which is like as shown below

D:\XXX\XXX\SXX_FX.zip\ADMIN

By using code...

@echo off 
Rem This is for copy down all the files in the directory 

set origin=D:\NXG\Backup_Prod\SGL_FINANCE\WebFolder\SGL_FINANCE.zip\ADMINAPP
set drive=D:\TEST3
set d1=%date:~4,2%
set d2=%date:~7,2%
set d3=%date:~10,4%

XCOPY "%origin%" "%drive%_%d1%%d2%%d3%.zip*" /s /Y
echo "The program has completed"

But I am getting the error message. File not found - ADMIN. Is it because I am trying to open the zipped file while copying.

Could you please throw some light on how to unzip that folder on the fly.

roottraveller
  • 7,942
  • 7
  • 60
  • 65
Vicky
  • 1
  • 1
  • 1
  • 2
    I'm voting to close this question as off-topic because it lacks minimum understanding. – aschipfl Oct 10 '16 at 06:08
  • 2
    Your system includes a "zip folders" extension that lets you work *from explorer* as if zip files were folders. This extension is not usable from command line, so, you will need some tool or script to unzip the required file. From `xcopy` point of view, zip files are files, not folders. – MC ND Oct 10 '16 at 06:18
  • 2
    Possible duplicate of [Batch file script to zip files](http://stackoverflow.com/questions/20485419/batch-file-script-to-zip-files) – sashoalm Oct 10 '16 at 07:18

1 Answers1

0

Using 7zip Take a "file.txt" from "Archive.zip" to "Destination\Folder"

"C:\Program Files\7-Zip\7z.exe" e -ir!file.txt "C:\Path\To\Archive.zip" -o"C:\Path\to\Destination\Folder\"
kgimpel
  • 594
  • 7
  • 8