Search found 1928 matches
- 18 Sep 2025 14:47
- Forum: DOS Batch Forum
- Topic: Batch script to show day of the year?
- Replies: 5
- Views: 11329
Re: Batch script to show day of the year?
I just devised a simpler method! :D @echo off setlocal for /F "tokens=1-3" %%a in ('wmic Path Win32_LocalTime Get Day^,Month^,Year') do ( set /A "day=%%a, month=%%b, year=%%c" ) set /A "dayOfYear=day + (month-1)*30 + (month+month/9)/2 - (((month-3)>>31)+1)*(2-!(year%%4))" echo %dayOfYear% Antonio
- 18 Sep 2025 11:31
- Forum: DOS Batch Forum
- Topic: Batch script to show day of the year?
- Replies: 5
- Views: 11329
Re: Batch script to show day of the year?
Some time ago I posted the simple Batch code below at this S.O. answer , @echo off setlocal set "daysPerMonth=0 31 28 31 30 31 30 31 31 30 31 30" for /F "tokens=1-3" %%a in ('wmic Path Win32_LocalTime Get Day^,Month^,Year') do ( set /A "dayOfYear=%%a, month=%%b, leap=!(%%c%%4)*(((month-3)>>31)+1)" 2...
- 30 Aug 2025 10:27
- Forum: DOS Batch Forum
- Topic: how can i get ansi.sys loaded in WinXP?
- Replies: 2
- Views: 1210
Re: how can i get ansi.sys loaded in WinXP?
You could review this post about my (abandoned) AnsiSys.exe program. If it works for you, I could fix the last bugs...
Antonio
Antonio
- 15 Aug 2025 20:48
- Forum: DOS Batch Forum
- Topic: Ghost-typer effect in batch: Flickering random letters before each character
- Replies: 4
- Views: 3948
Re: Ghost-typer effect in batch: Flickering random letters before each character
This code does exactly what you requested... @echo off rem Ghost typer setlocal EnableDelayedExpansion set "chars=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" set /A len=62, centiSecs=40, lines=0 for %%a in ("Twinkle twinkle little star" "How I wonder what you are" "Up above the w...
- 15 Aug 2025 18:28
- Forum: DOS Batch Forum
- Topic: Any DOS Batch game recommendations?
- Replies: 10
- Views: 3030
Re: Any DOS Batch game recommendations?
Mmm... I just could talk about the games I wrote by myself: 2012/06/20: SNAKE.BAT: Example of basic animated game (at end of this post ) 2014/06/24: 2048.bat game in color (using auxiliary .exe files). 2015/11/27: Tetris game in a pure Batch file 2016/04/12: Tetris in color (using Read arrow keys an...
- 24 Jul 2025 21:55
- Forum: DOS Batch Forum
- Topic: PAUSE localized... not really
- Replies: 11
- Views: 28707
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 . . ...
- 23 Jul 2025 00:26
- Forum: DOS Batch Forum
- Topic: PAUSE localized... not really
- Replies: 11
- Views: 28707
Re: PAUSE localized... not really
In Spanish (Windows 10):
Antonio
Code: Select all
Presione una tecla para continuar . . .
- 21 Jul 2025 09:16
- Forum: DOS Batch Forum
- Topic: strLen boosted
- Replies: 91
- Views: 229785
Re: strLen boosted
May I suggest a simple modification that may speed up the process when there are setlocal/endlocal and frequent environment updates? Just define a "filler" variable at end of the environment before the setlocal and then, inside the routine that update the environment, release such a variable: rem De...
- 30 Jun 2025 23:06
- Forum: DOS Batch Forum
- Topic: How to overcome 32-bits math limitation of BAT if PS1 workaround alerts HIPS repeatedly? [SOLVED]
- Replies: 5
- Views: 16119
Re: How to overcome 32-bits math limitation of BAT if PS1 workaround alerts HIPS repeatedly?
I reviewed these old posts: - Convert an unlimited size decimal number to binary - Convert an unlimited size decimal number to base 1024 (Bytes + KB + MB + ...) - Operations on big numbers - More on operations on big numbers - Fast Arithmetic Operations on Big Numbers - Efficient Array Management Op...
- 20 May 2025 21:50
- Forum: DOS Batch Forum
- Topic: edit command (CLI text editor) returns to Windows
- Replies: 4
- Views: 28430
Re: edit command (CLI text editor) returns to Windows
Mmm... More than 10 years ago I started to write a Batch file version of Edlin.com MS-DOS line editor. This was an interesting ancient editor that does not used the screen to browse along the file contents; it show file lines via user requests and also edits the lines in individual line-by-line basi...
- 16 May 2025 10:57
- Forum: DOS Batch Forum
- Topic: Simple script to reboot and automatically enter BIOS/UEFI
- Replies: 5
- Views: 15879
Re: Simple script to reboot and automatically enter BIOS/UEFI
Oye, por respeto a los demás miembros de este foro, debes publicar en inglés. Este es un foro en inglés...
Hey, with respect to the rest of members of this forum, you must write in English. This is an English forum...
Antonio
Hey, with respect to the rest of members of this forum, you must write in English. This is an English forum...
Antonio
- 14 May 2025 11:11
- Forum: DOS Batch Forum
- Topic: Simple script to reboot and automatically enter BIOS/UEFI
- Replies: 5
- Views: 15879
Re: Simple script to reboot and automatically enter BIOS/UEFI
Hi. I have not tested your code. I just want to note that you can get the same result in a simpler way. Instead of this code: CHOICE /c 1234567890 /n IF ERRORLEVEL 10 SET SEGS=600 & SET MINS=10 & (GOTO INICIO) IF ERRORLEVEL 9 SET SEGS=540 & SET MINS=09 & (GOTO INICIO) IF ERRORLEVEL 8 SET SEGS=480 & ...
- 03 May 2025 10:42
- Forum: DOS Batch Forum
- Topic: …and we’re back!
- Replies: 3
- Views: 11416
Re: …and we’re back!
Knows anyone what the problem was? And how it was solved?
Antonio
Antonio
- 19 Mar 2025 17:31
- Forum: DOS Batch Forum
- Topic: string replacer for 1 file but it needs looping to replace many OldStrings with NewStrings
- Replies: 2
- Views: 13056
Re: string replacer for 1 file but it needs looping to replace many OldStrings with NewStrings
Ok. There are a couple important details in this problem. The code below is designed to run fast with large input files. The input file is processed each time with one find string and just in the lines that contains the find string . The rest of the input lines are just copied as fast as possible. T...
- 11 Jan 2025 22:08
- Forum: DOS Batch Forum
- Topic: Use Netsh to save ip gw dns to variables for project
- Replies: 6
- Views: 14907
Re: Use Netsh to save ip gw dns to variables for project
Try this: @echo off setlocal FOR /F "tokens=3,*" %%A IN ('netsh interface show interface^|find "Connected"') DO set "conn=%%B" set "IP=" for /F "tokens=2 delims=:" %%a in ('netsh interface ip show address "%conn%" ^| findstr "Address Default"') do ( for %%b in (%%a) do if not defined IP (set "IP=%%b...