On Sat, 18 Jun 2022 at 11:45:06, R.Wieser <add...@not.available> wrote
(my responses usually FOLLOW):
>Pamela,
>
>> What is the correct syntax to add a second file to be defragged
>> when this .BAT file runs?
>
>Your batchfile is a bit special. It doesn't just run that defragging, but
>is ment to be used from a Windows shortcut. The "cmd /k" part makes sure
>the console window stays open after the defragging program terminates (so
>you can check if everything went well).
I am wondering what would happen if the "cmd /k" was put on a line by
itself, rather than the same line with a semicolon; would that open a
command window but then run subsequent lines in their own window(s)
which then close(s), or would those lines run in the window opened by
the "cmd /k" line?
>
>You could try to append a command using the "&" symbol :
>
>cmd /k; "C:\Program Files\Contig defragger\Contig.exe" -v "c:\SIGNATURE.DBM"
>& "C:\Program Files\Contig defragger\Contig.exe" -v "c:\otherfile.ext"
>
>, but that might run into the command-line max length limit (about 260
>chars)
>
>IOW, that "cmd /k" method is not really ment for multiple commands.
>
>
>There are a few solutions though:
>
>1) If you only need to run the defragging and than close the console window
>you could remove the "cmd /k;" part and put a "pause" command at the end :
>
>"C:\Program Files\Contig defragger\Contig.exe" -v "c:\SIGNATURE.DBM"
>"C:\Program Files\Contig defragger\Contig.exe" -v "c:\otherfile.ext"
>pause
or
C:
cd "\Program Files\Contig defragger"
Contig.exe -v "c:\SIGNATURE.DBM"
Contig.exe -v "c:\otherfile.ext"
pause
(-:
[The target file may not need to be in quotes either, depending on its
path.]
I'm wondering if two versions of contig can run at once. Given it's a
defragger, I suspect not. If it can, you might want to add the "start"
command. (Or the other way round; I forget the details.)
>
>The two instructions will be executed, and a "Press any key to continue ..."
>message will be shown. After pressing that "any key" the console window
>will close itself.
>
>...which might not be what you want.
>
>2) You can use two batchfiles, the first calling the second :
>
>-- first batchfile --
>
>cmd /k second.bat
>
>-- second.bat file --
>
>"C:\Program Files\Contig defragger\Contig.exe" -v "c:\SIGNATURE.DBM"
>"C:\Program Files\Contig defragger\Contig.exe" -v "c:\otherfile.ext"
>
>This way the first batchfile will open a console window that stays open,
>after which the second batchfile will execute whatever you like.
Clever!
>
>Hope that helps.
Ditto.
>
>Regards,
>Rudy Wieser
>
>
John
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf
> > Won't you come into the garden? I would like my roses to see you. -Richard