Search found 4589 matches
- 17 Aug 2025 04:04
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 80
- Views: 162980
Re: strLen boosted
Hmm, the new code performs slightly worse in my tests. Expanding !%%1:~4095,1! twice might be the reason, although it's a clever way to handle a space at this position.
- 13 Aug 2025 16:19
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 80
- Views: 162980
Re: strLen boosted
I'm still trying to address other given feedback without performance impact. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :initStrLen :: Computes the number of resulting UTF-16 code units in a string. :: %strLen% str [len] :: str - [ByRef In] Name of the variable ...
- 13 Aug 2025 12:20
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 80
- Views: 162980
Re: strLen boosted
This is so impressive 
BTW Was this known to work?
This would have been my expectation:

BTW Was this known to work?
Code: Select all
if not defined %%1 (if %%? lss ' endlocal)^&(set /a %%2=0) else^
Code: Select all
if not defined %%1 ((if %%? lss ' endlocal)^&set /a %%2=0) else^
- 11 Aug 2025 14:56
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 80
- Views: 162980
Re: strLen boosted
So, we define that delayed expansion is enabled but the cmd may gives us the finger
Like if I go to a hardware store to buy an 8mm nut, but the shop assistant decides that I only get one if I can show the matching screw
Got it. Thanks!

Like if I go to a hardware store to buy an 8mm nut, but the shop assistant decides that I only get one if I can show the matching screw

Got it. Thanks!
- 11 Aug 2025 13:23
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 80
- Views: 162980
Re: strLen boosted
Yes, of course, I fully understand why it works ... not 🤪🥴
I get why you use !=! since this can't ever be a defined variable. However what puzzles me is why it even makes any difference if it comes before the caret (or after it, as this seems to work too).
Anyway, I just accept it
Steffen
I get why you use !=! since this can't ever be a defined variable. However what puzzles me is why it even makes any difference if it comes before the caret (or after it, as this seems to work too).
Anyway, I just accept it

Steffen
- 10 Aug 2025 08:06
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 80
- Views: 162980
Re: strLen boosted
I would never have thought of that 
FWIW You could also update this in your previous codes. When you're logged in, you'll see an edit button (pencil) at the top of each of your posts. (Although it doesn't matter if not. The content of the strLen macro is not affected, only its initialization.)

FWIW You could also update this in your previous codes. When you're logged in, you'll see an edit button (pencil) at the top of each of your posts. (Although it doesn't matter if not. The content of the strLen macro is not affected, only its initialization.)
- 08 Aug 2025 14:11
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 80
- Views: 162980
Re: strLen boosted
Your HEX magic is incredible :lol: Also for short strings it's now only negligibly slower. The performance gain for longer string is remarkable though. That's how I'm going to save it into my tool collection: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :initStrLe...
- 06 Aug 2025 10:05
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 80
- Views: 162980
Re: strLen boosted
but I assumed there were no quotes for the variable That's a fair assumption. We can just remark it in the macro description as this is our contract with the user :wink: I hadn't noticed the reduction with "FOR %%H IN (FEDCBA9876543210)" Everything that comes before the "set StrLen=..." will not be...
- 05 Aug 2025 11:11
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 80
- Views: 162980
Re: strLen boosted
@pieh-ejdsch Thanks, got it now. I didn't consider that both expansion steps are performed, %%? to !! and !! to an empty string. And I would've expected it throws a syntax error due to a missing comparison operand in this case. (I know, reading is fun, it's all already explained over there https://s...
- 04 Aug 2025 11:41
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 80
- Views: 162980
Re: strLen boosted
At first glance this seems to be faster for strings >= 256 characters and slower if for strings is < 256 characters. I have to dig deeper when I have a little more time. Especial because I don't get why %%? must be > ' for SETLOCAL and < ' for ENDLOCAL. At the moment that doesn't make any sense to m...
- 03 Aug 2025 04:46
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 80
- Views: 162980
Re: strLen boosted
(Only yesterday I deleted most of my test codes to make room on my desktop again :lol: No problem as I published it here as well...) Hmm, I can't see any noticeable differences yet. Not even if I raise the number of iterations from 1,000 to 10,000. Perhaps If I increase them even more? The updated m...
- 30 Jul 2025 09:09
- Forum: DOS Batch Forum
- Topic: PAUSE localized... not really
- Replies: 11
- Views: 7988
Re: PAUSE localized... not really
As en-US is probably the fallback, you could run a quick loop to get what system apps and libraries are not localized. @echo off >"missing_mui.txt" ( for %%i in ("%systemroot%\system32\en-us\*.mui") do ( if not exist "%systemroot%\system32\sl-si\%%~nxi" echo %%~ni ) ) I assume the MUI files directly...
- 28 Jul 2025 09:31
- Forum: DOS Batch Forum
- Topic: PAUSE localized... not really
- Replies: 11
- Views: 7988
Re: PAUSE localized... not really
If I check the language folders in C:\Windows\System32\ then I have 1781 files in the en-US folder and 1715 files in the de-DE (German) folder. They both contain the cmd.exe.mui file for the localized messages of the cmd.exe. Along with a lot more language folders, I also have a sl-SI folder with on...
- 25 Jul 2025 09:57
- Forum: DOS Batch Forum
- Topic: PAUSE localized... not really
- Replies: 11
- Views: 7988
Re: PAUSE localized... not really
- What exactly you did to get this listing? I really used Copilot. Recent versions of Edge should have a button in the top right corner to open it. I didn't explicitly ask for the Slovenian translation. Instead I entered something like "What are localized messages of the PAUSE command in cmd.exe?" ...
- 23 Jul 2025 14:07
- Forum: DOS Batch Forum
- Topic: PAUSE localized... not really
- Replies: 11
- Views: 7988
Re: PAUSE localized... not really
That's a case where I already appreciate Copilot and AI friends :lol: English Press any key to continue . . . German Drücken Sie eine beliebige Taste . . . French Appuyez sur une touche pour continuer . . . Spanish Presione una tecla para continuar . . . Italian Premere un tasto per continuare . . ....