Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"Never make any mistaeks." (Anonymous, in a mail discussion about to a kernel bug report.)


computers / microsoft.public.windowsxp.general / Re: Syntax of commands in BAT file

SubjectAuthor
* Syntax of commands in BAT filePamela
+* Syntax of commands in BAT fileR.Wieser
|+* Syntax of commands in BAT fileJ. P. Gilliver (John)
||+- Syntax of commands in BAT fileR.Wieser
||`* Syntax of commands in BAT fileJJ
|| `* Syntax of commands in BAT fileJ. P. Gilliver (John)
||  `- Syntax of commands in BAT fileR.Wieser
|+* Syntax of commands in BAT fileJJ
||`* Syntax of commands in BAT fileR.Wieser
|| `* Syntax of commands in BAT filePaul
||  `- Syntax of commands in BAT fileJJ
|`* Syntax of commands in BAT filePamela
| +- Syntax of commands in BAT fileR.Wieser
| `- Syntax of commands in BAT filePaul
`- Syntax of commands in BAT fileJJ

1
Syntax of commands in BAT file

<XnsAEBA685BC625437B93@144.76.35.252>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3450&group=microsoft.public.windowsxp.general#3450

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: pamela.private.mailbox@gmail.com (Pamela)
Newsgroups: microsoft.public.windowsxp.general
Subject: Syntax of commands in BAT file
Date: Sat, 18 Jun 2022 10:15:31 +0100
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <XnsAEBA685BC625437B93@144.76.35.252>
Injection-Info: reader02.eternal-september.org; posting-host="5b525a4244a668fc6d86d6afa33674ef";
logging-data="7473"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18L5du3ngo2NqQp2WNslgiEjpozBz7KqMU="
User-Agent: Xnews/2009.05.01
Cancel-Lock: sha1:xBXJN921lURo0CJJfPebf5gMVsM=
 by: Pamela - Sat, 18 Jun 2022 09:15 UTC

I use the commands shown below in a .BAT file in order to run Mark
Russinovich's "Contig" defragger on a file called SIGNATURE.DBM.

What is the correct syntax to add a second file to be defragged when
this .BAT file runs?

This runs on WinXP/SP3.

----

cmd /k; "C:\Program Files\Contig defragger\Contig.exe" -v "c:
\SIGNATURE.DBM"

Re: Syntax of commands in BAT file

<t8k6rd$j71$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3451&group=microsoft.public.windowsxp.general#3451

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!3.us.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!usenet.goja.nl.eu.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: microsoft.public.windowsxp.general
Subject: Re: Syntax of commands in BAT file
Date: Sat, 18 Jun 2022 11:45:06 +0200
Organization: Aioe.org NNTP Server
Lines: 56
Message-ID: <t8k6rd$j71$1@gioia.aioe.org>
References: <XnsAEBA685BC625437B93@144.76.35.252>
Injection-Info: gioia.aioe.org; logging-data="19681"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-Priority: 3
X-Notice: Filtered by postfilter v. 0.9.2
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Sat, 18 Jun 2022 09:45 UTC

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).

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

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.

Hope that helps.

Regards,
Rudy Wieser

Re: Syntax of commands in BAT file

<a2lGqftX8ariFwL+@a.a>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3452&group=microsoft.public.windowsxp.general#3452

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!3.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 18 Jun 2022 05:56:26 -0500
Message-ID: <a2lGqftX8ariFwL+@a.a>
Date: Sat, 18 Jun 2022 11:55:19 +0100
From: G6JPG@255soft.uk (J. P. Gilliver (John))
Reply-To: G6JPG@255soft.uk
Newsgroups: microsoft.public.windowsxp.general
Subject: Re: Syntax of commands in BAT file
References: <XnsAEBA685BC625437B93@144.76.35.252>
<t8k6rd$j71$1@gioia.aioe.org>
Organization: 255 software
MIME-Version: 1.0
Content-Type: text/plain;charset=us-ascii;format=flowed
User-Agent: Turnpike/6.07-M (<7TsDL82X8kSn8AEgqVfACA5fof>)
Lines: 89
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-8PG8fJ5sWTZpvSbf9YLE+i+Hdkoir23PbwBFgdd7flnRmQPuHy49WyLwb9RKbA2GF6nRmKdYNJxktnJ!mSUdRqb3rA3RZhbCoMR0skn+BRCRAAsH4BxRiNI7PS7SaoqBmK40M2xHnt0KvB8=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 3885
 by: J. P. Gilliver (John - Sat, 18 Jun 2022 10:55 UTC

On Sat, 18 Jun 2022 at 11:45:06, R.Wieser <address@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

Re: Syntax of commands in BAT file

<t8kg47$ii3$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3454&group=microsoft.public.windowsxp.general#3454

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: microsoft.public.windowsxp.general
Subject: Re: Syntax of commands in BAT file
Date: Sat, 18 Jun 2022 14:23:23 +0200
Organization: Aioe.org NNTP Server
Lines: 48
Message-ID: <t8kg47$ii3$1@gioia.aioe.org>
References: <XnsAEBA685BC625437B93@144.76.35.252> <t8k6rd$j71$1@gioia.aioe.org> <a2lGqftX8ariFwL+@a.a>
Injection-Info: gioia.aioe.org; logging-data="19011"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Priority: 3
X-MSMail-Priority: Normal
X-RFC2646: Format=Flowed; Response
X-Notice: Filtered by postfilter v. 0.9.2
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Sat, 18 Jun 2022 12:23 UTC

John,

> I am wondering what would happen if the "cmd /k" 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)

:-) I also thought of that and have tried it. Its the latter, but with a(n
expected) twist : the batchfile which runs the "cmd /k" command (which seems
to ignore the semicolon by the way) and waits for that console window to be
closed before it runs the following line(s).

> I'm wondering if two versions of contig can run at once.

Thats a good question I did not think about. Its Windows program though,
so it /should/ be able to cope with other programs using files running at
the same time.

>>There are a few solutions though:
>> 1)
....

>or
>
> C:
> cd "\Program Files\Contig defragger"

Yep, that would be a further optimalisation. In the case of the OP I
wanted to keep it as simple as possible though (no changes that do not have
anything to do with the question). Too easy to make it, to the OP, look
like a confusing mess.

>>2) You can use two batchfiles, the first calling the second :
....
> Clever!

:-) I'm pretty-much using that method myself to open a console window and
configure it (switching to 80x25 mode, setting some environment variables)

Though if a shortcut is used the whole contents of that first batchfile can
ofcourse just be put inside of it. But again, I didn't want to make any
assumptions (not even educated ones) or any change that would not be
directly related to the solution.

Regards,
Rudy Wieser

Re: Syntax of commands in BAT file

<x7nofkqee40s.1evyvrwansucf$.dlg@40tude.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3459&group=microsoft.public.windowsxp.general#3459

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jj4public@gmx.com (JJ)
Newsgroups: microsoft.public.windowsxp.general
Subject: Re: Syntax of commands in BAT file
Date: Sun, 19 Jun 2022 08:30:29 +0700
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <x7nofkqee40s.1evyvrwansucf$.dlg@40tude.net>
References: <XnsAEBA685BC625437B93@144.76.35.252>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="80905acfe06944b24595aecaa0010a0b";
logging-data="19741"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Gps+scTYHdfjFpc2tcK/wP5oEm1bXlEA="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:ZC5PL/z031kmoXhy33sjecaLu7U=
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
 by: JJ - Sun, 19 Jun 2022 01:30 UTC

On Sat, 18 Jun 2022 10:15:31 +0100, Pamela wrote:

> I use the commands shown below in a .BAT file in order to run Mark
> Russinovich's "Contig" defragger on a file called SIGNATURE.DBM.
>
> What is the correct syntax to add a second file to be defragged when
> this .BAT file runs?
>
> This runs on WinXP/SP3.
>
> ----
>
> cmd /k; "C:\Program Files\Contig defragger\Contig.exe" -v "c:
> \SIGNATURE.DBM"

CONTIG only accept one file command line argument. Either with exact file
name, or with wildcard(s) e.g.

contig.exe "d:\my files\*.dat"

With CONTIG, to defrag multiple files by specifying exact file names, CONTIG
has to be executed multiple times for each exact file name like the first
example given by R.Weiser. The "&" character is for command line separator.

Or, use a FOR loop e.g. (long text warning)

cmd /k for %A in (file.dat "file 2.dat" d:\folder\file.dat) do "C:\Program
Files\Contig defragger\Contig.exe" -v "%~A"

Re: Syntax of commands in BAT file

<3w0dwh9qfz3v$.1nxkhm6yevonz$.dlg@40tude.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3460&group=microsoft.public.windowsxp.general#3460

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jj4public@gmx.com (JJ)
Newsgroups: microsoft.public.windowsxp.general
Subject: Re: Syntax of commands in BAT file
Date: Sun, 19 Jun 2022 08:30:54 +0700
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <3w0dwh9qfz3v$.1nxkhm6yevonz$.dlg@40tude.net>
References: <XnsAEBA685BC625437B93@144.76.35.252> <t8k6rd$j71$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="80905acfe06944b24595aecaa0010a0b";
logging-data="19891"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19LHzxKIIwkfJBtXGteX8bVc8xu5hqH6Bk="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:iTWgJ2YePOEQ0VMAqeLHD10aNVk=
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
 by: JJ - Sun, 19 Jun 2022 01:30 UTC

>
> 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)

Uh... that 260 chars is the limit for file path length. The command line
limit is 8192 chars. Within CMD, that would be after any variables have been
expanded.

Re: Syntax of commands in BAT file

<yjyyzye2rxtv$.1b4lxde53x2xw.dlg@40tude.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3461&group=microsoft.public.windowsxp.general#3461

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jj4public@gmx.com (JJ)
Newsgroups: microsoft.public.windowsxp.general
Subject: Re: Syntax of commands in BAT file
Date: Sun, 19 Jun 2022 08:50:34 +0700
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <yjyyzye2rxtv$.1b4lxde53x2xw.dlg@40tude.net>
References: <XnsAEBA685BC625437B93@144.76.35.252> <t8k6rd$j71$1@gioia.aioe.org> <a2lGqftX8ariFwL+@a.a>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="80905acfe06944b24595aecaa0010a0b";
logging-data="26307"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+K6u1Ea3339ivZHH01ewhw3drBP5EpKsA="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:P1ljeqkTHMLr876s8asFjFLphPU=
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
 by: JJ - Sun, 19 Jun 2022 01:50 UTC

On Sat, 18 Jun 2022 11:55:19 +0100, J. P. Gilliver (John) wrote:
>
> 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.)

It can, but the defragging algorithm will conflict with each other, since
CONTIG is not designed to be cooperative with its own instances.

e.g. CONTIG#1 is run first and is at 50% of defragging a big file
"d:\abc.dat". Then CONTIG#2 is run for a different file. CONTIG#2 then is
run for a small file "d:\xyz.dat", but CONTIG#2 may sea and use the free
space where the 2nd half of file "d:\abc.dat" would be, as the destination
location for "d:\xyz.dat". So CONTIG#2 may unknowingly sabotage CONTIG#1
defragmentation process.

Re: Syntax of commands in BAT file

<t8mjum$1kmj$2@gioia.aioe.org>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3463&group=microsoft.public.windowsxp.general#3463

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: microsoft.public.windowsxp.general
Subject: Re: Syntax of commands in BAT file
Date: Sun, 19 Jun 2022 09:40:08 +0200
Organization: Aioe.org NNTP Server
Lines: 22
Message-ID: <t8mjum$1kmj$2@gioia.aioe.org>
References: <XnsAEBA685BC625437B93@144.76.35.252> <t8k6rd$j71$1@gioia.aioe.org> <3w0dwh9qfz3v$.1nxkhm6yevonz$.dlg@40tude.net>
Injection-Info: gioia.aioe.org; logging-data="53971"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-RFC2646: Format=Flowed; Original
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
X-Priority: 3
 by: R.Wieser - Sun, 19 Jun 2022 07:40 UTC

JJ,

> Uh... that 260 chars is the limit for file path length.

Indeed.

> The command line limit is 8192 chars. Within CMD, that would be
> after any variables have been expanded.

Well, that makes sense, knowing that you /should/ be able to type two
looonnnggg filenames to a simple "copy" command. To be honest, I have
wondered about it for quite some time.

Thank you for mentioning it, as I can't remember having ever come across it
: although "cmd /?" shows a /lot/ of information, that tidbid is absent. :-\

(Now lets hope I will keep remembering it)

Regards,
Rudy Wieser

Re: Syntax of commands in BAT file

<t8mp5n$ett$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3464&group=microsoft.public.windowsxp.general#3464

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!paganini.bofh.team!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: nospam@needed.invalid (Paul)
Newsgroups: microsoft.public.windowsxp.general
Subject: Re: Syntax of commands in BAT file
Date: Sun, 19 Jun 2022 05:10:14 -0400
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <t8mp5n$ett$1@dont-email.me>
References: <XnsAEBA685BC625437B93@144.76.35.252>
<t8k6rd$j71$1@gioia.aioe.org> <3w0dwh9qfz3v$.1nxkhm6yevonz$.dlg@40tude.net>
<t8mjum$1kmj$2@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 19 Jun 2022 09:10:15 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="79fbac1a5f5c1bb13ae7865211a86743";
logging-data="15293"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rVmVdw7P8KA2mZr5BgGCN1BgV66c2XRk="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:rMacIijnp9W9YIcSRSm4urk03NY=
In-Reply-To: <t8mjum$1kmj$2@gioia.aioe.org>
Content-Language: en-US
 by: Paul - Sun, 19 Jun 2022 09:10 UTC

On 6/19/2022 3:40 AM, R.Wieser wrote:
> JJ,
>
>> Uh... that 260 chars is the limit for file path length.
>
> Indeed.
>
>> The command line limit is 8192 chars. Within CMD, that would be
>> after any variables have been expanded.
>
> Well, that makes sense, knowing that you /should/ be able to type two
> looonnnggg filenames to a simple "copy" command. To be honest, I have
> wondered about it for quite some time.
>
> Thank you for mentioning it, as I can't remember having ever come across it
> : although "cmd /?" shows a /lot/ of information, that tidbid is absent. :-\
>
> (Now lets hope I will keep remembering it)
>
> Regards,
> Rudy Wieser

Some competing shells, have a 2MB limit on their environment.
Which allows a somewhat longer line :-)

I would wonder if an 8192 limit would be in keeping with
the limits on the most expansive file system option. This is
optional and not the default on install. The funny thing about
this notion, was it was announced for earlier OSes, but never
"realized". And because it's not the default, we won't know
if it actually works or not. The 32,767 characters are likely
2 bytes each as well, rather than being USASCII. That's
so you could type 32,767 Hungarian characters.

https://www.itprotoday.com/windows-10/enable-long-file-name-support-windows-10

"Prior to Windows 10, the maximum supported file name length was 260 characters.

In Windows 10, that maximum was extended to 32,767 characters."

"(although you lose a few characters for mandatory characters
that are part of the name)"

HKLM\SYSTEM\CurrentControlSet\Control\FileSystem
LongPathsEnabled DWORD 1

Now imagine what your "copy from to" command looks like :-)

Paul

Re: Syntax of commands in BAT file

<tIcr1d+y7wriFwP0@a.a>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3466&group=microsoft.public.windowsxp.general#3466

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 19 Jun 2022 06:56:56 -0500
Message-ID: <tIcr1d+y7wriFwP0@a.a>
Date: Sun, 19 Jun 2022 12:56:34 +0100
From: G6JPG@255soft.uk (J. P. Gilliver (John))
Reply-To: G6JPG@255soft.uk
Newsgroups: microsoft.public.windowsxp.general
Subject: Re: Syntax of commands in BAT file
References: <XnsAEBA685BC625437B93@144.76.35.252> <t8k6rd$j71$1@gioia.aioe.org> <a2lGqftX8ariFwL+@a.a> <yjyyzye2rxtv$.1b4lxde53x2xw.dlg@40tude.net>
Organization: 255 software
MIME-Version: 1.0
Content-Type: text/plain;charset=us-ascii;format=flowed
User-Agent: Turnpike/6.07-M (<zRlDL0Sf8kCl0CEgKNdACgx7ez>)
Lines: 33
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-Tn27pCklzf0Pi/phfaymrixYiBjwa1Qx3R6egelAKw8/Tl/dHLv0bzIqJk0qIgwBCMw2d4rElTjIOj8!Zo2cICrdVys8AMKn+NxTJPhj3JPGy9B0FP4hCjqICBcnIKL2MruI223itO5iLwY=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2799
X-Received-Bytes: 2938
 by: J. P. Gilliver (John - Sun, 19 Jun 2022 11:56 UTC

On Sun, 19 Jun 2022 at 08:50:34, JJ <jj4public@gmx.com> wrote (my
responses usually FOLLOW):
>On Sat, 18 Jun 2022 11:55:19 +0100, J. P. Gilliver (John) wrote:
>>
>> 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.)
>
>It can, but the defragging algorithm will conflict with each other, since
>CONTIG is not designed to be cooperative with its own instances.
>
>e.g. CONTIG#1 is run first and is at 50% of defragging a big file
>"d:\abc.dat". Then CONTIG#2 is run for a different file. CONTIG#2 then is
>run for a small file "d:\xyz.dat", but CONTIG#2 may sea and use the free
>space where the 2nd half of file "d:\abc.dat" would be, as the destination
>location for "d:\xyz.dat". So CONTIG#2 may unknowingly sabotage CONTIG#1
>defragmentation process.

That's the sort of thing I had in mind; basically (assuming the two
files are on the same partition!), I can't see it being possible to run
two instances of the same defragger at the same time - not unless there
are extra parameters about which part of disc, block sizes, and the
like.

Hence my wondering about whether START was needed (or is the opposite of
what's needed). I guess it depends on how the command itself - and the
batch shell - acts, in terms of returning control before it's completed.
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

There are things that we should be free by law to say but choose not to. A
right to offend doesn't mean a duty to offend.
- Timothy Garton Ash, RT 2016/4/9-15

Re: Syntax of commands in BAT file

<XnsAEBB89561CEA037B93@144.76.35.252>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3467&group=microsoft.public.windowsxp.general#3467

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: pamela.private.mailbox@gmail.com (Pamela)
Newsgroups: microsoft.public.windowsxp.general
Subject: Re: Syntax of commands in BAT file
Date: Sun, 19 Jun 2022 13:30:02 +0100
Organization: A noiseless patient Spider
Lines: 67
Message-ID: <XnsAEBB89561CEA037B93@144.76.35.252>
References: <XnsAEBA685BC625437B93@144.76.35.252> <t8k6rd$j71$1@gioia.aioe.org>
Injection-Info: reader02.eternal-september.org; posting-host="478347b91fe0937b8273a21cc3200d0c";
logging-data="27040"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Qogn4LAffUPslA9BQXNJV23TTg11ikuA="
User-Agent: Xnews/2009.05.01
Cancel-Lock: sha1:6qrrZxJKMznFrwa+62HlC/LICOk=
 by: Pamela - Sun, 19 Jun 2022 12:30 UTC

On 10:45 18 Jun 2022, R.Wieser said:

> 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).
>
> 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
>
> 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.

That works fine for me. Thank you.

> 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.

This is a bit messier than I would like on account of the additional
file.

> Hope that helps.
>
> Regards,
> Rudy Wieser

Re: Syntax of commands in BAT file

<t8n9uh$8ir$2@gioia.aioe.org>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3469&group=microsoft.public.windowsxp.general#3469

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: microsoft.public.windowsxp.general
Subject: Re: Syntax of commands in BAT file
Date: Sun, 19 Jun 2022 15:56:17 +0200
Organization: Aioe.org NNTP Server
Lines: 23
Message-ID: <t8n9uh$8ir$2@gioia.aioe.org>
References: <XnsAEBA685BC625437B93@144.76.35.252> <t8k6rd$j71$1@gioia.aioe.org> <a2lGqftX8ariFwL+@a.a> <yjyyzye2rxtv$.1b4lxde53x2xw.dlg@40tude.net> <tIcr1d+y7wriFwP0@a.a>
Injection-Info: gioia.aioe.org; logging-data="8795"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-MSMail-Priority: Normal
X-RFC2646: Format=Flowed; Response
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
 by: R.Wieser - Sun, 19 Jun 2022 13:56 UTC

John,

> I can't see it being possible to run two instances of the same defragger
> at the same time

Thats not too much of a problem as both instances could use some private IPC
method (like a a named pipe) to talk with each other about who's doing what
and where. And seeing the name of who wrote Contig (Mark Russinovich) I
would not be amazed at all if he did such a thing.

> Hence my wondering about whether START was needed (or is the opposite of
> what's needed).

Its the opposite. START can be used in a batchfile as a way to run several
programs next to each other - all in their own windows.

The batchfile mechanism itself already takes care of waiting for a started
program to terminate before advancing to the next line.

Regards,
Rudy Wieser

Re: Syntax of commands in BAT file

<t8nac5$dqm$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3470&group=microsoft.public.windowsxp.general#3470

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!aioe.org!XakcSTEO51npqVb7OVl71w.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: microsoft.public.windowsxp.general
Subject: Re: Syntax of commands in BAT file
Date: Sun, 19 Jun 2022 16:03:35 +0200
Organization: Aioe.org NNTP Server
Lines: 25
Message-ID: <t8nac5$dqm$1@gioia.aioe.org>
References: <XnsAEBA685BC625437B93@144.76.35.252> <t8k6rd$j71$1@gioia.aioe.org> <XnsAEBB89561CEA037B93@144.76.35.252>
Injection-Info: gioia.aioe.org; logging-data="14166"; posting-host="XakcSTEO51npqVb7OVl71w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Priority: 3
X-Notice: Filtered by postfilter v. 0.9.2
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
X-RFC2646: Format=Flowed; Original
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
 by: R.Wieser - Sun, 19 Jun 2022 14:03 UTC

Pamela,

>> "C:\Program Files\Contig defragger\Contig.exe" -v "c:\SIGNATURE.DBM"
>> "C:\Program Files\Contig defragger\Contig.exe" -v "c:\otherfile.ext"
>> pause
....
> That works fine for me. Thank you.

You're welcome.

By the way, if you do not need to know what Contig all has to say than you
could choose to remove the "pause" at the end. The commands will than run,
but than as soon as the last one ends the console window will close too.

>> 2) You can use two batchfiles, the first calling the second :
....
> This is a bit messier than I would like on account of the
> additional file.

Hence the different options to choose from. :-)

Regards,
Rudy Wieser

Re: Syntax of commands in BAT file

<t8nmca$qq0$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3471&group=microsoft.public.windowsxp.general#3471

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: nospam@needed.invalid (Paul)
Newsgroups: microsoft.public.windowsxp.general
Subject: Re: Syntax of commands in BAT file
Date: Sun, 19 Jun 2022 13:28:41 -0400
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <t8nmca$qq0$1@dont-email.me>
References: <XnsAEBA685BC625437B93@144.76.35.252>
<t8k6rd$j71$1@gioia.aioe.org> <XnsAEBB89561CEA037B93@144.76.35.252>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 19 Jun 2022 17:28:43 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="79fbac1a5f5c1bb13ae7865211a86743";
logging-data="27456"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1946W0DrnY1lxF6NsKDldPAiaQTRlz3Tlw="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:MV5KNRafaYwoG3bmN2OfzYQpn2w=
In-Reply-To: <XnsAEBB89561CEA037B93@144.76.35.252>
Content-Language: en-US
 by: Paul - Sun, 19 Jun 2022 17:28 UTC

On 6/19/2022 8:30 AM, Pamela wrote:

> This is a bit messier than I would like on account of the additional file.

JKDefrag can defragment enumerated files.

There is a "doc" directory with info on the command line invocation.
Use double-quotes on paths with spaces.

JkDefrag f:\*.log D:\MySQL\Data\*

Although, I might try commands like this:

jkdefrag -a 1 -d 2 "f:\*.log" "D:\MySQL\Data\*" # Type 1, is "analyse only"
jkdefrag -a 2 -d 2 "f:\*.log" "D:\MySQL\Data\*" # Type 2 is "defragment"
jkdefrag -a 5 -d 2 "f:\*.log" "D:\MySQL\Data\*" # Type 3 is "push file toward origin"

Only the middle command is of much use in this case.

Normal usage is more like this:

jkdefrag -a 1 -d 2 Q: # Check Q: for fragmentation

I keep a copy of 3.36.0.2 on every C: drive. On Windows 10
it defragments the files larger than 50MB for me.

There's lots of things it won't defragment, but at least
it does user files.

Paul

Re: Syntax of commands in BAT file

<i0pneilyk4wr$.ci2jwzx2p81w$.dlg@40tude.net>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=3472&group=microsoft.public.windowsxp.general#3472

  copy link   Newsgroups: microsoft.public.windowsxp.general
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jj4public@gmx.com (JJ)
Newsgroups: microsoft.public.windowsxp.general
Subject: Re: Syntax of commands in BAT file
Date: Mon, 20 Jun 2022 02:38:32 +0700
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <i0pneilyk4wr$.ci2jwzx2p81w$.dlg@40tude.net>
References: <XnsAEBA685BC625437B93@144.76.35.252> <t8k6rd$j71$1@gioia.aioe.org> <3w0dwh9qfz3v$.1nxkhm6yevonz$.dlg@40tude.net> <t8mjum$1kmj$2@gioia.aioe.org> <t8mp5n$ett$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="80905acfe06944b24595aecaa0010a0b";
logging-data="20816"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ZEyGi4octRQk/Q3T/us17Ai8eFm5M3ew="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:rknAkDXNMiy2l35erkN1z3jb8sk=
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
 by: JJ - Sun, 19 Jun 2022 19:38 UTC

On Sun, 19 Jun 2022 05:10:14 -0400, Paul wrote:
>
> I would wonder if an 8192 limit would be in keeping with
> the limits on the most expansive file system option. This is
> optional and not the default on install. The funny thing about
> this notion, was it was announced for earlier OSes, but never
> "realized". And because it's not the default, we won't know
> if it actually works or not. The 32,767 characters are likely
> 2 bytes each as well, rather than being USASCII. That's
> so you could type 32,767 Hungarian characters.
>
> https://www.itprotoday.com/windows-10/enable-long-file-name-support-windows-10
>
> "Prior to Windows 10, the maximum supported file name length was 260 characters.
>
> In Windows 10, that maximum was extended to 32,767 characters."
>
> "(although you lose a few characters for mandatory characters
> that are part of the name)"
>
> HKLM\SYSTEM\CurrentControlSet\Control\FileSystem
> LongPathsEnabled DWORD 1

We can actually use file paths longer than 260 chars (up to 32767, AFAIK),
but the path must be using device namespace like the one listed by MOUNTVOL.
e.g.

dir "\\?\Volume{a03841f7-0842-11e6-aba0-806e6f6e6963}\my dir\blah dir"

Or...

type "\\?\Volume{a03841f7-0842-11e6-aba0-806e6f6e6963}\my dir\file.txt"

Or...

dir "d:\my dir" > \\?\Volume{a03841f7-0842-11e6-aba0-806e6f6e6963}\out.txt

The storage volume/partition doesn't even need to have any assigned drive
letter. Though it can't be used for all conditions.

In CMD, some commands would be inapplicable (e.g. VOL) or may fail. The
device namespace path would also be limited by CMD's 8192 chars command line
limit.

And if applications specifically validate a given path based only on Win32
namespace path, or only treat the given path as Win32 namespace path, they
will surely fail. e.g. ATTRIB, EXPLORER.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor