How to unzip a ZIP archive file using batch file? [duplicate]
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
batch-file unzip
marked as duplicate by Mofi
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.
add a comment |
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
batch-file unzip
marked as duplicate by Mofi
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
add a comment |
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
batch-file unzip
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
batch-file unzip
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
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
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
add a comment |
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.
add a comment |
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.
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.
answered Nov 11 '18 at 5:05
jwdonahuejwdonahue
2,6072924
2,6072924
add a comment |
add a comment |
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