Search found 255 matches
- 13 Aug 2025 15:12
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 77
- Views: 145971
Re: strLen boosted
I saw that in Francesco's code. Then I tried it out. IF (a TRUE condition) & some more code that should also be fulfilled if TRUE & then something else that should be done if TRUE & (then the last little thing for TRUE) ELSE now the code that comes up if FALSE & something else that comes up if FALSE...
- 13 Aug 2025 10:34
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 77
- Views: 145971
Re: strLen boosted
New macro [edit]I played around with the command chain a bit and sped up an if else (which no longer has an else). You should check it again with the old (rejected) code. It didn't run any faster—I had changed too much at once.[/edit] The penultimate else has now been moved up. This has eliminated a...
- 12 Aug 2025 04:47
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 77
- Views: 145971
Re: strLen boosted
OK! Strange that the macro still works. Regardless of whether I have delayed ON or OFF during creation or execution. Well, that gave me the idea to include the colon in the first comparison instead of using the exclamation mark. Because the single exclamation mark is not [empty] in the CMD line (wit...
- 10 Aug 2025 07:41
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 77
- Views: 145971
Re: strLen boosted
I have made the creation of the exclamation mark and caret a little shorter, which happens before the macro is created. FOR /F "tokens=1-3" %%! IN ("! ! ^ ^^^! . ^^^^") DO ^ It looks a little strange, but since the first caret disappears in delayed expansion, it can already be used as the third token.
- 07 Aug 2025 12:26
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 77
- Views: 145971
Re: strLen boosted
@Francesco Here is a brief summary of the steps again. The things I changed were: Converting the use of For variables into hard-coded delayed normal variables as early as possible. Since For variables can be used well as name storage, but expanding the For variable within exclamation marks takes tim...
- 07 Aug 2025 09:00
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 77
- Views: 145971
Re: strLen boosted
Well, Francesco, I tinkered with the macros until they got faster and achieved this performance The quotation marks can be omitted everywhere if the variable expansion does not contain a comma. The closing brackets are attached directly to the variables to be set, as is the follow-up command. set /a...
- 04 Aug 2025 15:39
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 77
- Views: 145971
Re: strLen boosted
The first token in the For-loop can actually be a single exclamation mark, just like in if. The parser first evaluates the loop or the if and the exclamation mark is only resolved at execution time. Two exclamation marks are also larger than the ' . Twice (empty) is also smaller than ' . The exclama...
- 04 Aug 2025 08:25
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 77
- Views: 145971
Re: strLen boosted
I couldn't resist writing an even shorter and faster version than yesterday's after trying out lots of different things. I noticed the following: A for variable with a tilde ~ slows down execution because any quotation marks have to be removed first—regardless of whether there are any or not. Using ...
- 03 Aug 2025 12:56
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 77
- Views: 145971
Re: strLen boosted
Hi at all, I've created a few versions so you can see why it runs faster or slower. In any case, the final2 version isn't the fastest. Ultimately, every unnecessary "if else" and every too many "set statements" and "variable calls" slows down the script. But you can find a balance between these many...
- 15 Jun 2025 09:33
- Forum: DOS Batch Forum
- Topic: Stack Overflow article.
- Replies: 6
- Views: 6985
Re: Stack Overflow article.
The main problem that AI brings with it: It only ever presents solutions to past problems. That's why I see AI as a data collector that can't analyze problems itself, but will only present solved problems over and over again for problems that have already been solved. Throw the syntax of the command...
- 18 Mar 2025 15:23
- Forum: DOS Batch Forum
- Topic: Copy PDFs from publish subfolder to two other locations
- Replies: 1
- Views: 4392
Re: Copy PDFs from publish subfolder to two other locations
hallo Calm, Are the file names formed according to any naming conventions that can be used for distribution? Which files should be copied? All those that are NOT saved in C:\BOX? Or should the data to be saved be selected again separately? c/box/project/123 - job name /01 drawings/pdfs/1000 - ELEV c...
- 23 Feb 2025 07:20
- Forum: DOS Batch Forum
- Topic: recursive dir name reading to make dir named batches(only 2 bytes used from reading)
- Replies: 8
- Views: 9046
Re: recursive dir name reading to make dir named batches(only 2 bytes used from reading)
Then please start this "CMD"-line that I have written for you in your host system (not Dosbox-x). We say command line, but this has remained the same over time although we now use different program names. In DosBoxx-x the command: “cmd.exe” is not supported. first it is not available in the “pathVar...
- 22 Feb 2025 12:22
- Forum: DOS Batch Forum
- Topic: recursive dir name reading to make dir named batches(only 2 bytes used from reading)
- Replies: 8
- Views: 9046
Re: recursive dir name reading to make dir named batches(only 2 bytes used from reading)
with the CMD liner you could see the directories which can be changed or which can remain as they are cmd /v /c " (for /f "delims=" %a in ('dir /s/b/ad D:\A_test') do @set "N=%~nxa" &set "n2=!n:~0,2!" &if NOT defined _!n2! (set "_!n2!=1" &echo T!n2!) else set "nx=T!n:~0,2!_!n:~2,3!" &if not defined ...
- 21 Feb 2025 11:31
- Forum: DOS Batch Forum
- Topic: recursive dir name reading to make dir named batches(only 2 bytes used from reading)
- Replies: 8
- Views: 9046
Re: recursive dir name reading to make dir named batches(only 2 bytes used from reading)
Hallo (nm)³, Do you absolutely want to name the batch with the first two characters of the folder name, even though there may be name collisions because there are also three-letter names and the first two combinations occur several times? Perhaps this can be better avoided by using the first and las...
- 03 Jan 2025 13:58
- Forum: DOS Batch Forum
- Topic: need some corrections of processing a batch for "!" for DelayedExpansion
- Replies: 2
- Views: 22254
Re: need some corrections of processing a batch for "!" for DelayedExpansion
When set the Variables with "!" - you need to turn of delayedExpansion. Otherwise you won't have any exclamation marks in the variable. @ECHO OFF SetLocal EnableExtensions disableDelayedExpansion SET P1=C:\firefox.exe SET K1=D:\a\F9-WEBSITE.TXT set "lineC=" REM **************************************...