|
Answer» type '.zip.exe' at command prompt: it should display something as follow: Code: [Select]D:\batch>.zip
7-Zip 4.57 Copyright (c) 1999-2007 Igor Pavlov 2007-12-06
Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...] [<@listfiles...>]hi dear reno well i don't have 7zip installed on my system so when i typed .zip.exe in CMD i saw error massage
Quote Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\sss>.zip.exe '.zip.exe' is not recognized as an internal or external command, operable program or batch file. well i did not navigate to my folder through CMD but i did something else that defined my file is not bad !! i copied .zip.exe in a folder and typed .zip.exe in a bat file and executed bat file you can see the result
QuoteF:\bbb\delet zip>.zip.exe
7-Zip 4.62 Copyright (c) 1999-2008 Igor Pavlov 2008-12-02
Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...] [<@listfiles...>]
<Commands> a: Add files to archive b: Benchmark d: Delete files from archive e: Extract files from archive (without using directory names) l: List contents of archive t: Test integrity of archive u: UPDATE files to archive x: eXtract files with full paths <Switches> -ai[r[-|0]]{@listfile|!wildcard}: Include archives -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives -bd: Disable percentage indicator -i[r[-|0]]{@listfile|!wildcard}: Include filenames -m{Parameters}: set compression Method -o{Directory}: set Output directory -p{Password}: set Password -r[-|0]: Recurse subdirectories -scs{UTF-8 | WIN | DOS}: set charset for list files -sfx[{name}]: Create SFX archive -si[{name}]: read data from stdin -slt: show technical information for l (List) command -so: write data to stdout -ssc[-]: set sensitive case mode -ssw: compress shared files -t{Type}: Set type of archive -v{Size}[b|k|m|g]: Create volumes -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options -w[{path}]: assign Work directory. Empty path means a temporary directory -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames -y: assume Yes on all queries so my file is a command version right RENO? now what's wrong? would you please read my previous post again? thanksadmitted it that i dont have an answer for this. i have used that batch script for months, and works well as i intend it to.
change echo off to echo on, then if you could post some screen output which line and file name goes wrong, i try my best to ASSIST. hi to all specially my dear RENO RENO you were right !! i had created 2 empty folders and compressed them..... because of that program could not extract anything i apologize for that i did not saw that there are some switches in your program ====================================================== but now i created 2 folders and put some files inside both of them and then compressed them to names below my rar.rar my zip.zip and added (.zip.exe , .Rar.exe and reno.bat) and execute bat file it extracted all files and folders and deleted my rar.rar file but my zip.zip is still exist !! it's just hiden but not deleted below you can see the result in a CMD window QuoteC:\delet zip>for /F "tokens=*" %a in ('dir /b *.rar *.zip') do (%~xa e -y "%~a" && attrib +h "%~a" )
C:\delet zip>(.rar e -y "my rar.rar" && attrib +h "my rar.rar" )
RAR 3.80 Copyright (c) 1993-2008 Alexander Roshal 16 Sep 2008 Shareware version Type RAR -? for help
Extracting from my rar.rar
Extracting New Rich TEXT Document.rtf OK All OK
C:\delet zip>(.zip e -y "my zip.zip" && attrib +h "my zip.zip" )
7-Zip 4.62 Copyright (c) 1999-2008 Igor Pavlov 2008-12-02
Processing archive: my zip.zip
Extracting my zip Extracting my zip\New Text Document.txt
Everything is Ok
Folders: 1 Files: 1 Size: 10 Compressed: 251
C:\delet zip>for /F "tokens=*" %a in ('dir/b/ah *.zip *.rar') do (for /F "tokens =*" %b in ('%~xa lb "%a"') do (dir/b "%b" 1>nul 2>&1 && (del/a "%a" && echo DELETE: %a ) ) )
C:\delet zip>(for /F "tokens=*" %b in ('.zip lb "my zip.zip"') do (dir/b "%b" 1>nul 2>&1 && (del/a "my zip.zip" && echo DELETE: my zip.zip ) ) )
C:\delet zip>(dir/b "7-Zip 4.62 Copyright (c) 1999-2008 Igor Pavlov 2008-12-02 " 1>nul 2>&1 && (del/a "my zip.zip" && echo DELETE: my zip.zip ) )
C:\delet zip>(dir/b "Error:" 1>nul 2>&1 && (del/a "my zip.zip" && echo DELE TE: my zip.zip ) )
C:\delet zip>(dir/b "Incorrect command line" 1>nul 2>&1 && (del/a "my zip.zip " && echo DELETE: my zip.zip ) )
C:\delet zip>(for /F "tokens=*" %b in ('.rar lb "my rar.rar"') do (dir/b "%b" 1>nul 2>&1 && (del/a "my rar.rar" && echo DELETE: my rar.rar ) ) )
C:\delet zip>(dir/b "New Rich Text Document.rtf" 1>nul 2>&1 && (del/a "my rar .rar" && echo DELETE: my rar.rar ) ) DELETE: my rar.rar
C:\delet zip>(dir/b "my rar" 1>nul 2>&1 && (del/a "my rar.rar" && echo DELE TE: my rar.rar ) )
C:\delet zip>pause Press any key to continue . . . i am speechless. the 2 batch file is not meant to be combined into one.
instead use this: Code: [Select]@echo off
for /f "tokens=*" %%a in ('dir /b *.rar *.zip') do ( %%~xa e -y "%%~a" && del "%%~a" ) pause there is a HUGE bug that need to be fix in _clean.bat at post #2, there is no 'lb' switch in 7z.exe. so don't use script at post#2. thank you for reporting a bug. wow thanks RENO what a powerful script it's so fast even before i start it it finished !! fantastic it's working like a charm it extract files and delet compressed files with no error . it is very delightful that this website has a programmer like you ============================================== now with a test i have my 2 final questions that will be very greatful if you solve them
how can we replace (*.rar .*.zip) with our file names? i don't want to all files to be extracted .just need those files that i order get extracted thanks can you give an example for replacable file names (for both zip and rar files at the same time) thanks has someone seen RENO around?
|