| 1. |
Solve : once compressed, redirect compressed file to another command line? |
|
Answer» Hi, I have learned from past experience that some programs just dont obey the wait option. Command line exectutables don't need the start command. Anyhow, from a batch file he should be using the 7-Zip command line executable, 7za.exe. This returns only when the compression/archiving task is done. It's at 7-zip.org. personally i already use auto-it and even if it is a good software, i agree that some applications do not respond to wait... but more than that i don't want to use any artefact or extra software for that...i know because i already saw it on web that it is possible without that solution. for example my first command like could be: "c:\Program Files\7-Zip\7z.exe" a -r -mx9 -ttar my_archive my_folder_to_compress/*.* and the 2nd command line should be in this case: "c:\Program Files\7-Zip\7z.exe" a -r -mx9 -tgzip my_archive my_archive.tar Auto-it is just an example folder I used. I don't think you understood what I wrote. If you don't want to use "extra software", why are you using 7-zip? Why don't you use the 7-zip command line version 7za.exe? This would avoid all your problems. Is English not your first language? (LA langue des rosbifs n'est pas ta langue maternelle ?) I use 7z.exe and it works to pass the command to the archiver and wait for the file to be created. This should work. Code: [Select]@echo off set "file=My_Archive" "c:\Program Files\7-Zip\7z.exe" a -r -mx9 -ttar "%file%.tar" "my_folder_to_compress\*" "c:\Program Files\7-Zip\7z.exe" a -r -mx9 -tgzip "%file%.tgz" "%file%.tar"Quote from: foxidrive on April 01, 2013, 03:45:16 PM This should work. This did work, both in a batch (7-zip did not return until each task was complete) and also when entered at the prompt... Note: my Windows is 64 bit, so it installs 32 bit programs under C:\Program Files (x86)\. On a 32 bit system the install will be under C:\Program Files\ U:\Pan2>dir doctest Volume in drive U is USB-U Volume Serial Number is 70B2-B275 Directory of U:\Pan2\doctest 02/04/2013 18:53 <DIR> . 02/04/2013 18:53 <DIR> .. 14/02/2003 11:17 11,776 aseptic01.doc 14/02/2003 11:17 11,776 aseptic02.doc 14/02/2003 11:17 11,776 aseptic03.doc 14/02/2003 11:17 11,776 aseptic04.doc 14/02/2003 11:17 11,776 aseptic05.doc 14/02/2003 11:17 11,776 aseptic06.doc 14/02/2003 11:17 11,776 aseptic07.doc 14/02/2003 11:17 11,776 aseptic08.doc 14/02/2003 11:17 11,776 aseptic09.doc 14/02/2003 11:17 11,776 aseptic10.doc 10 File(s) 117,760 bytes 2 Dir(s) 318,992,576,512 bytes free U:\Pan2>"C:\Program Files (x86)\7-Zip\7z.exe" a -r -mx9 -ttar "Doctest.tar" "Doctest\*" 7-Zip 4.65 Copyright (c) 1999-2009 Igor Pavlov 2009-02-03 Scanning Creating archive Doctest.tar Compressing Doctest\aseptic01.doc Compressing Doctest\aseptic02.doc Compressing Doctest\aseptic03.doc Compressing Doctest\aseptic04.doc Compressing Doctest\aseptic05.doc Compressing Doctest\aseptic06.doc Compressing Doctest\aseptic07.doc Compressing Doctest\aseptic08.doc Compressing Doctest\aseptic09.doc Compressing Doctest\aseptic10.doc Everything is Ok U:\Pan2>"C:\Program Files (x86)\7-Zip\7z.exe" a -r -mx9 -tgzip "Doctest.tgz" "Doctest.tar" 7-Zip 4.65 Copyright (c) 1999-2009 Igor Pavlov 2009-02-03 Scanning Creating archive Doctest.tgz Compressing Doctest.tar Everything is Ok U:\Pan2>dir doctest* Volume in drive U is USB-U Volume Serial Number is 70B2-B275 Directory of U:\Pan2 02/04/2013 18:53 <DIR> Doctest 02/04/2013 18:54 123,904 Doctest.tar 02/04/2013 18:55 2,654 Doctest.tgz 2 File(s) 126,558 bytes 1 Dir(s) 318,992,576,512 bytes free |
|