How to unzip a ZIP archive file using batch file? [duplicate]










2
















This question already has an answer here:



  • How can I compress (/ zip ) and uncompress (/ unzip ) files and folders with batch file without using any external tools?

    3 answers



I would like to use a .bat file to unzip a ZIP compressed archive file if possible at all. Nothing fancy, I just want to extract the entire archive file to the same location, i.e. download a .zip file to desktop and want to extract it next to desktop with the same name.



I tried this, but with no success.



for /R "C:UsersDesktoptest.zip" %%I in ("*.zip") do(
"%ProgramFiles(x86)%7-zip7z.exe" x - y -o"%%~dpnI" "%%~fI"
)
exit









share|improve this question















marked as duplicate by Mofi batch-file
Users with the  batch-file badge can single-handedly close batch-file questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 11 '18 at 11:16


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Break it into smaller chunks. Try getting the unzip working on a single file.

    – Squashman
    Nov 11 '18 at 3:47











  • Do you want to unzip one archive or many?

    – jwdonahue
    Nov 11 '18 at 4:59















2
















This question already has an answer here:



  • How can I compress (/ zip ) and uncompress (/ unzip ) files and folders with batch file without using any external tools?

    3 answers



I would like to use a .bat file to unzip a ZIP compressed archive file if possible at all. Nothing fancy, I just want to extract the entire archive file to the same location, i.e. download a .zip file to desktop and want to extract it next to desktop with the same name.



I tried this, but with no success.



for /R "C:UsersDesktoptest.zip" %%I in ("*.zip") do(
"%ProgramFiles(x86)%7-zip7z.exe" x - y -o"%%~dpnI" "%%~fI"
)
exit









share|improve this question















marked as duplicate by Mofi batch-file
Users with the  batch-file badge can single-handedly close batch-file questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 11 '18 at 11:16


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Break it into smaller chunks. Try getting the unzip working on a single file.

    – Squashman
    Nov 11 '18 at 3:47











  • Do you want to unzip one archive or many?

    – jwdonahue
    Nov 11 '18 at 4:59













2












2








2









This question already has an answer here:



  • How can I compress (/ zip ) and uncompress (/ unzip ) files and folders with batch file without using any external tools?

    3 answers



I would like to use a .bat file to unzip a ZIP compressed archive file if possible at all. Nothing fancy, I just want to extract the entire archive file to the same location, i.e. download a .zip file to desktop and want to extract it next to desktop with the same name.



I tried this, but with no success.



for /R "C:UsersDesktoptest.zip" %%I in ("*.zip") do(
"%ProgramFiles(x86)%7-zip7z.exe" x - y -o"%%~dpnI" "%%~fI"
)
exit









share|improve this question

















This question already has an answer here:



  • How can I compress (/ zip ) and uncompress (/ unzip ) files and folders with batch file without using any external tools?

    3 answers



I would like to use a .bat file to unzip a ZIP compressed archive file if possible at all. Nothing fancy, I just want to extract the entire archive file to the same location, i.e. download a .zip file to desktop and want to extract it next to desktop with the same name.



I tried this, but with no success.



for /R "C:UsersDesktoptest.zip" %%I in ("*.zip") do(
"%ProgramFiles(x86)%7-zip7z.exe" x - y -o"%%~dpnI" "%%~fI"
)
exit




This question already has an answer here:



  • How can I compress (/ zip ) and uncompress (/ unzip ) files and folders with batch file without using any external tools?

    3 answers







batch-file unzip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 '18 at 11:15









Mofi

28k83777




28k83777










asked Nov 11 '18 at 1:48









adamrowe16495adamrowe16495

111




111




marked as duplicate by Mofi batch-file
Users with the  batch-file badge can single-handedly close batch-file questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 11 '18 at 11:16


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Mofi batch-file
Users with the  batch-file badge can single-handedly close batch-file questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 11 '18 at 11:16


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Break it into smaller chunks. Try getting the unzip working on a single file.

    – Squashman
    Nov 11 '18 at 3:47











  • Do you want to unzip one archive or many?

    – jwdonahue
    Nov 11 '18 at 4:59

















  • Break it into smaller chunks. Try getting the unzip working on a single file.

    – Squashman
    Nov 11 '18 at 3:47











  • Do you want to unzip one archive or many?

    – jwdonahue
    Nov 11 '18 at 4:59
















Break it into smaller chunks. Try getting the unzip working on a single file.

– Squashman
Nov 11 '18 at 3:47





Break it into smaller chunks. Try getting the unzip working on a single file.

– Squashman
Nov 11 '18 at 3:47













Do you want to unzip one archive or many?

– jwdonahue
Nov 11 '18 at 4:59





Do you want to unzip one archive or many?

– jwdonahue
Nov 11 '18 at 4:59












1 Answer
1






active

oldest

votes


















0














You shouldn't need the loop. Depending on whether you want to extract the directory structure contained within the archive or just extract everything to a single directory, you would use:



7z e C:UsersDesktoptest.zip -o C:UsersDesktoptest


or



7z x C:UsersDesktoptest.zip -o C:UsersDesktoptest


See https://sevenzip.osdn.jp/chm/cmdline/commands/index.htm for a list of commands and drill down as needed for the various options.



You should not need a for loop in your batch file, unless you intend to only extract files based on a list of patterns.






share|improve this answer





























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You shouldn't need the loop. Depending on whether you want to extract the directory structure contained within the archive or just extract everything to a single directory, you would use:



    7z e C:UsersDesktoptest.zip -o C:UsersDesktoptest


    or



    7z x C:UsersDesktoptest.zip -o C:UsersDesktoptest


    See https://sevenzip.osdn.jp/chm/cmdline/commands/index.htm for a list of commands and drill down as needed for the various options.



    You should not need a for loop in your batch file, unless you intend to only extract files based on a list of patterns.






    share|improve this answer



























      0














      You shouldn't need the loop. Depending on whether you want to extract the directory structure contained within the archive or just extract everything to a single directory, you would use:



      7z e C:UsersDesktoptest.zip -o C:UsersDesktoptest


      or



      7z x C:UsersDesktoptest.zip -o C:UsersDesktoptest


      See https://sevenzip.osdn.jp/chm/cmdline/commands/index.htm for a list of commands and drill down as needed for the various options.



      You should not need a for loop in your batch file, unless you intend to only extract files based on a list of patterns.






      share|improve this answer

























        0












        0








        0







        You shouldn't need the loop. Depending on whether you want to extract the directory structure contained within the archive or just extract everything to a single directory, you would use:



        7z e C:UsersDesktoptest.zip -o C:UsersDesktoptest


        or



        7z x C:UsersDesktoptest.zip -o C:UsersDesktoptest


        See https://sevenzip.osdn.jp/chm/cmdline/commands/index.htm for a list of commands and drill down as needed for the various options.



        You should not need a for loop in your batch file, unless you intend to only extract files based on a list of patterns.






        share|improve this answer













        You shouldn't need the loop. Depending on whether you want to extract the directory structure contained within the archive or just extract everything to a single directory, you would use:



        7z e C:UsersDesktoptest.zip -o C:UsersDesktoptest


        or



        7z x C:UsersDesktoptest.zip -o C:UsersDesktoptest


        See https://sevenzip.osdn.jp/chm/cmdline/commands/index.htm for a list of commands and drill down as needed for the various options.



        You should not need a for loop in your batch file, unless you intend to only extract files based on a list of patterns.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 11 '18 at 5:05









        jwdonahuejwdonahue

        2,6072924




        2,6072924













            Popular posts from this blog

            𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

            Edmonton

            Crossroads (UK TV series)