Search found 1919 matches

by Aacini
20 May 2025 21:50
Forum: DOS Batch Forum
Topic: edit command (CLI text editor) returns to Windows
Replies: 3
Views: 6345

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...
by Aacini
16 May 2025 10:57
Forum: DOS Batch Forum
Topic: Simple script to reboot and automatically enter BIOS/UEFI
Replies: 4
Views: 1552

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
by Aacini
14 May 2025 11:11
Forum: DOS Batch Forum
Topic: Simple script to reboot and automatically enter BIOS/UEFI
Replies: 4
Views: 1552

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 & ...
by Aacini
03 May 2025 10:42
Forum: DOS Batch Forum
Topic: …and we’re back!
Replies: 3
Views: 3146

Re: …and we’re back!

Knows anyone what the problem was? And how it was solved?

Antonio
by Aacini
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: 4010

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...
by Aacini
11 Jan 2025 22:08
Forum: DOS Batch Forum
Topic: Use Netsh to save ip gw dns to variables for project
Replies: 6
Views: 7735

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...
by Aacini
17 Dec 2024 20:58
Forum: DOS Batch Forum
Topic: is this possible?
Replies: 1
Views: 6856

Re: is this possible?

Mmm... Your question title is very undescriptive... "is this possible?" (What is possible? In the description you talk about a syntax error)... The problem is that all your variable names, like starter-str includes a dash that is also used for subtract operation in set /A command. You can not do tha...
by Aacini
16 Dec 2024 09:55
Forum: DOS Batch Forum
Topic: Tokens do not pass after 31, is there some way that i can pass this limit?
Replies: 6
Views: 10052

Re: Tokens do not pass after 31, is there some way that i can pass this limit?

I am afraid I don't understand why you use precisely a FOR /F command that requires a tokens=40 switch. There are a lot of different ways to separate the elements of a list. For example, you can separate the elements in an array first, and then easily show the individual array elements. I am aware t...
by Aacini
15 Dec 2024 09:22
Forum: DOS Batch Forum
Topic: Tokens do not pass after 31, is there some way that i can pass this limit?
Replies: 6
Views: 10052

Re: Tokens do not pass after 31, is there some way that i can pass this limit?

You can use the method implemented at this reply.

For a description of the limitations of the FOR /F tokens command, see the reply before that. For a fully description of this matter, review the whole Using many "tokens=..." in FOR /F command in a simple way thread...

Antonio
by Aacini
09 Dec 2024 14:14
Forum: DOS Batch Forum
Topic: is there a way for echo (coordinate row, coordinate column)?
Replies: 4
Views: 9798

Re: is there a way for echo (coordinate row, coordinate column)?

This seems to me as X-Y problem. If you generate the 50 rows in sequential order, you can store the Channel A: rows in an array, and then show the array elements in the same lines of Channel B: rows: @echo off setlocal EnableDelayedExpansion rem Generate Channel A: rows and store they in an array fo...
by Aacini
08 Dec 2024 15:21
Forum: DOS Batch Forum
Topic: Split a filename containing wildcards in path and name without expanding the wildcards
Replies: 6
Views: 10050

Re: Split a filename containing wildcards in path and name without expanding the wildcards

Antonio Your code gives incorrect output for the path: filename=c:\one\two\*\four\*.c path=c:.c\one\two\*\four name=*.c I have made a modified version: . . . . . Mmm... My code fail if there is a name variable before the program run, that is, if you remove the setlocal EnableDelayedExpansion comman...
by Aacini
06 Dec 2024 14:33
Forum: DOS Batch Forum
Topic: Split a filename containing wildcards in path and name without expanding the wildcards
Replies: 6
Views: 10050

Re: Split a filename containing wildcards in path and name without expanding the wildcards

This simple one-liner works no matter the number nor the position of the wildcards: @echo off setlocal EnableDelayedExpansion set "filename=c:\one\two\*\four\*.c" set "fpath=%filename:\=" & set "fpath=!fpath!!name!" & set "name=\%" & set "name=!name:~1!" echo filename=%filename% echo path=%fpath% ec...
by Aacini
22 Nov 2024 14:46
Forum: DOS Batch Forum
Topic: The Daily Calendar Puzzle
Replies: 3
Views: 13706

Re: The Daily Calendar Puzzle

@Saso, Yes... I didn't want to use wmic.exe to get the correct date in any locale so as not to complicate the code further... The whole point of this program is to solve the calendar puzzle... I found a small bug in the definition of pieces 2 and 3, and another when handling dates with day or month ...
by Aacini
18 Nov 2024 20:04
Forum: DOS Batch Forum
Topic: The Daily Calendar Puzzle
Replies: 3
Views: 13706

The Daily Calendar Puzzle

The "Daily Calendar Puzzle" is a toy comprised of a board with squares marked with the Month names, Days numbers and DayOfWeek names, and 10 different pieces that covers most squares, but leaves 3 spaces in the board. The goal of the puzzle is to place the pieces in a way that the 3 spaces correspon...
by Aacini
13 Nov 2024 04:11
Forum: DOS Batch Forum
Topic: Question about unattended or silent uninstallation
Replies: 5
Views: 16983

Re: Question about unattended or silent uninstallation

Try this: @if (@CodeSection == @Batch) @then @echo off rem Use %SendKeys% to send keys to the keyboard buffer set SendKeys=CScript //nologo //E:JScript "%~F0" rem Start the other program in the same Window start "" /B rundll32.exe dfshim.dll,ShArpMaintain ComponentesHarware.application, Culture=neut...