windows batch script to unzip a file -
i trying create batch file gets zipped folder particular date (v_date) sftp site , unzip them. zip file contains 5 files text documents. have written batch scripts zip file remote site , save copy of on local drive. need incorporate unzip part in script.
set v_date=%1 if [%v_date%] == [] set v_date=%date:~10,4%%date:~4,2%%date:~7,2% echo option batch continue>ftp_file_get.txt echo option confirm off>>ftp_file_get.txt echo open target>>ftp_file_get.txt echo lcd "m:\development\data history\file" >> ftp_file_get.txt echo cd /export/file >> ftp_file_get.txt echo /export/file/filename_%v_date%.zip "m:\development\datahistory\filename_%v_date%.zip">>ftp_file_get.txt echo exit>>ftp_file_get.txt m:\temp\apps\winscp\winscp.com/script="m:\development\sftpbatchfiles\ftp_file_get.txt" del ftp_file_get.txt
this code unzip:
set v_date=%1 if [%v_date%] == [] set v_date=%date:~10,4%%date:~4,2%%date:~7,2% cd "m:\development\data history\" ::set v_file="m:\development\data history\filename_%v_date%.zip" ::unzip -o %v_file% "c:\program files\7-zip\7z.exe" e "filename_%v_date%.zip"
i need move extracted files (6 files) respective folders, appreciated
to unzip files can use command line:
"c:\program files\7-zip\7z.exe" e "filename.zip"
Comments
Post a Comment