-2

I have two issues with this code I have attached below,

  1. it doesn't delete the original file after unzip, I want the script to delete the original file from source folder
  2. the converted file is not saved in target folder as set but it creates a tree of the directory in the same folder of the script and saved output there.

Please help me solve this issue

Sample code I have tried

@echo off
set "source=%userprofile%\Desktop\basanta\Automation\a"
set "target=%userprofile%\Desktop\basanta\Automation\b"
FOR %%A IN ("%source%\*.gz") DO (
     "%programfiles%\7-zip\7z.exe" x "%%~A" -o"%target%\%%~pA"
     del "%%~A" /Y
)

Please help me to write the script as described above

oguz ismail
  • 1
  • 16
  • 47
  • 69

1 Answers1

0

try: del file /f /q try to enclose -o parameter with a quotes: "-o%target%"