Search found 227 matches
- 29 Jan 2024 05:45
- Forum: DOS Batch Forum
- Topic: is there a DOS command for running a program with windows 98 compatibility?
- Replies: 11
- Views: 10782
Re: is there a DOS command for running a program with windows 98 compatibility?
There's actually now a simple way to run any real DOS command.com in 64-bits Windows 10/11, including Windows 98's DOS 7.1 if you wish. This allows testing batch files intended for Windows 98... Provided that they use only text-mode features, no graphics. For that, download the msdos.exe DOS kernel ...
- 22 Jan 2024 04:44
- Forum: DOS Batch Forum
- Topic: 3D Cube Orthographic Projection
- Replies: 3
- Views: 4250
Re: 3D Cube Orthographic Projection
Nice work! The problem with your post above is that the ESC characters in your source code did not make it through to the web server. This is a common problem with ASCII control characters. In the case of the ESC character, there's an easy workaround: First change: set "esc=" <nul set /p "=[?25l" to...
- 19 Jan 2024 11:42
- Forum: DOS Batch Forum
- Topic: Faster batch macros
- Replies: 17
- Views: 11176
Re: Faster batch macros
Thanks @jeb, it's very clear now.
- 18 Jan 2024 09:54
- Forum: DOS Batch Forum
- Topic: infinite loop with break condition
- Replies: 75
- Views: 113054
Re: infinite loop with break condition
Use substring substitution to replace the break variable for each additional while IE \b1 for the first break, \b2 for the second and so on I understand the advantage of generating unique break variable names for each loop. But I don't understand which substring substitution would allow to do that....
- 18 Jan 2024 08:10
- Forum: DOS Batch Forum
- Topic: infinite loop with break condition
- Replies: 75
- Views: 113054
Re: infinite loop with break condition
OK, I resolved the two issues I had left :D 1) The slower performance of the %WHILE(% macro was due to a (set "-=") instruction that was used purely as a NOP. (This NOP is necessary because I needed to negate the continuation condition, and I couldn't do it by ending the %WHILE(% macro with 'if not'...
- 18 Jan 2024 07:13
- Forum: DOS Batch Forum
- Topic: NOP+nested code.
- Replies: 25
- Views: 22799
Re: NOP+nested code.
I searched for a discussion about a good NOP command, and only found this old one. While investigating why my %WHILE(% macro was slower that my %REPEAT% macro, I began to suspect that the culprit was a (set -=) instruction, that was used as a NOP. After finding this discussion, I timed that particul...
- 17 Jan 2024 11:07
- Forum: DOS Batch Forum
- Topic: Batch Parser
- Replies: 2
- Views: 4106
Re: Batch Parser
Surely there must be one in Wine's cmd.exe clone.
But I don't know how compatible it is with all our favorite Batch quirks.
But I don't know how compatible it is with all our favorite Batch quirks.
- 17 Jan 2024 08:10
- Forum: DOS Batch Forum
- Topic: custom console window banner
- Replies: 4
- Views: 6121
Re: custom console window banner
Banner printing in first script work fine, prompt change (to avoid printing banner again) from second file also work fine, but command itself is printed too. If the goal is to print a banner once, why not simply echo that banner once in a single autorun script, instead of changing the prompt twice ...
- 17 Jan 2024 07:18
- Forum: DOS Batch Forum
- Topic: Faster batch macros
- Replies: 17
- Views: 11176
Re: Faster batch macros
I'm still not sure if I like this better. :lol: Arthur Clarke once said that perfection was reached, not when you can't add anything anymore to your system, but when you can't remove anything from it without it stopping functionning. I think you may have reached perfection here. Which brings a ques...
- 16 Jan 2024 11:36
- Forum: DOS Batch Forum
- Topic: infinite loop with break condition
- Replies: 75
- Views: 113054
Re: infinite loop with break condition
Update: With 10000 loops per second, the 1 million loops limit is sufficient for just 100 seconds. This is obviously too short for an infinite loop! I repeated the test with 4 billion loops, enough for a week. And the good news is that the impact on performance is negligible. Here are the updated ma...
- 16 Jan 2024 11:06
- Forum: DOS Batch Forum
- Topic: Faster batch macros
- Replies: 17
- Views: 11176
- 16 Jan 2024 10:20
- Forum: DOS Batch Forum
- Topic: infinite loop with break condition
- Replies: 75
- Views: 113054
Re: infinite loop with break condition
I really liked this way of breaking out of a loop, and immediately started to experiment with it :D My first idea was to define a %BREAK% macro like this: set BREAK=set "-break=-" This works, and is very readable, with code looking like: if condition %BREAK% But there's a catch: It should only be us...
- 15 Jan 2024 09:56
- Forum: DOS Batch Forum
- Topic: Faster batch macros
- Replies: 17
- Views: 11176
Re: Faster batch macros
A very clever trick indeed, but maybe a bit more complex than necessary? Here's a simpler version, that's also easier to understand: (I think) For /f %%! in ("! ^! ^^^!") Do ^ Set ThisMacro=For %%. in (1 2) Do if %%.==2 (%\n% FOR /F "tokens=2-4" %%1 in ("%%!%%! SETLOCAL REM ENDLOCAL REM") DO (%\n% %...
- 12 Jan 2023 05:51
- Forum: DOS Batch Forum
- Topic: Poll: Where, and how, to install your own tools
- Replies: 1
- Views: 6812
Poll: Where, and how, to install your own tools
One of the shortcomings of my System Tools Library is that it has no setup program. And the reason I never wrote one is that I don't know where, nor how, to install these tools in the general case. :( So I'm doing a poll now: Where do you store your own program and scripts? Would you have any recomm...
- 10 Jan 2023 12:54
- Forum: DOS Batch Forum
- Topic: @echo off does not work for timeout [SOLVED]
- Replies: 7
- Views: 12691
Re: @echo off does not work for timeout
I'd rather suggest:
Code: Select all
timeout /t 6 | findstr /r ".0$" >nul && goto continue || exit