Search found 1677 matches

by Aacini
22 Jan 2021 01:14
Forum: DOS Batch Forum
Topic: RPN.exe: Floating-point arithmetic operations in Reverse Polish Notation
Replies: 0
Views: 50

RPN.exe: Floating-point arithmetic operations in Reverse Polish Notation

When floating point operations are required in a Batch file, the possible solutions are limited to just a few options. PowerShell is a common solution, but it is very slow . JScript is more efficient, but it also have some drawbacks. The other possible standard methods to perform non-integer operati...
by Aacini
10 Jan 2021 21:23
Forum: DOS Batch Forum
Topic: Start, wait, start, wait till exit, then start batch file?
Replies: 3
Views: 249

Re: Start, wait, start, wait till exit, then start batch file?

Try this: taskkill /F /IM "gameex.exe" /T D:\Launchbox\bigbox.exe start "" "D:\GameEx\gameex.exe" This Batch file closes gameex.exe, then executes bigbox.exe, then waits until bigbox.exe is terminated, either manually or by any other method, to pass to the next line (that, by the way, is the standar...
by Aacini
08 Jan 2021 23:36
Forum: DOS Batch Forum
Topic: Best way to parse out string from output? Is this acceptable?
Replies: 6
Views: 359

Re: Best way to parse out string from output? Is this acceptable?

Your description of the problem is confusing/incomplete... In first place, your code does not extract outbox/logs/GPM_30585.log as you said, but just GPM_30585.log Executing a pipe to a FINDSTR command is much less efficient than directly giving the filename as parameter of FINDSTR. In FINDSTR comma...
by Aacini
28 Nov 2020 14:07
Forum: DOS Batch Forum
Topic: Find missing items in a list of element
Replies: 3
Views: 854

Re: Find missing items in a list of element

@echo off setlocal EnableDelayedExpansion rem Load numbers in a list and get the max set "list= " set "max=0" for /F %%a in (input.txt) do ( set "line=%%a" set /A "num=1!line:~26,6!-1000000" set "list=!list!!num! " if !num! gtr !max! set "max=!num!" ) rem Show missing numbers from 1..max for /L %%i...
by Aacini
23 Nov 2020 20:28
Forum: DOS Batch Forum
Topic: Event-driven multi-thread scheme for Batch files
Replies: 14
Views: 8547

Re: Event-driven multi-thread scheme for Batch files

I wrote a new version of this application designed to process several files in simultaneous way via parallel threads that is one of the most requested applications of parallel processing in Batch files. The general scheme of this version is the one suggested by jeb : Main | Process-1 | Process-2 | P...
by Aacini
18 Nov 2020 21:38
Forum: DOS Batch Forum
Topic: About variable expansion
Replies: 8
Views: 1332

Re: About variable expansion

This simpler method works if the string start with number: @echo off setlocal EnableDelayedExpansion set "result=" set "string=120400082_V1_UTR_HN512_gfhtgnnrt" :parse for /F "tokens=1* delims=0123456789" %%a in ("%string%") do set "result=!result!*%%a" & set "string=%%b" if defined string goto pars...
by Aacini
08 Nov 2020 09:48
Forum: DOS Batch Forum
Topic: Batch Games
Replies: 31
Views: 37491

Re: Batch Games

Perhaps you could be interested in my Tetris game in a pure Batch file that uses no additional or auxiliary programs. There is also a version of Tetris in color that uses a PowerShell engine to Read arrow keys and show color text in an efficient way.

Antonio

Image
by Aacini
03 Nov 2020 19:50
Forum: DOS Batch Forum
Topic: 2D Array simulation
Replies: 5
Views: 1263

Re: 2D Array simulation

You can directly do that Using SETX command to get tokens from a file via X,Y coordinates of the desired token...

Antonio
by Aacini
29 Oct 2020 09:24
Forum: DOS Batch Forum
Topic: A killer : in a comment
Replies: 15
Views: 1990

Re: A killer : in a comment

Just as a personal preference, I used to use %/* C STYLE COMMENT */%...

Antonio
by Aacini
05 Oct 2020 04:41
Forum: DOS Batch Forum
Topic: [How-To] Calculate the date of Easter Sunday, for both the Gregorian and the Julian (Orthodox) Calendar
Replies: 2
Views: 1459

Re: [How-To] Calculate the date of Easter Sunday, for both the Gregorian and the Julian (Orthodox) Calendar

At the end of this post I posted some time ago this subroutine that calculate the Easter Sunday based on integer arithmetic: :EasterSunday year rem Calculate the date of Christian Easter Sunday of any given year rem Antonio Perez Ayala set /A A=%1%%19, B=%1/100, C=%1%%100, D=B/4, E=B%%4, F=(B+8)/25,...
by Aacini
10 Sep 2020 20:02
Forum: DOS Batch Forum
Topic: A problem with symlink script
Replies: 6
Views: 1626

Re: A problem with symlink script

I think you should start indicating that your "symlink script" is really a Batch-file script (specifically, one called "Symlink-Creator.bat") The problem with special Batch-file characters (like ! % & < > | ) is very well known... I suggest you to list the problematic file names and post the Batch-f...
by Aacini
03 Sep 2020 12:57
Forum: DOS Batch Forum
Topic: Copy, duplicate, rename...all that works, but the valuecheck is missing
Replies: 8
Views: 1698

Re: Copy, duplicate, rename...all that works, but the valuecheck is missing

Sorry. I will not read any message that have the full text posted in colors and/or bold text with no reason...

Antonio
by Aacini
12 Aug 2020 09:08
Forum: DOS Batch Forum
Topic: Letter used in a variable.
Replies: 15
Views: 2928

Re: Letter used in a variable.

Mmmm... You entirely changed my code... Why you did that? In my answer I said that "the user enter just one letter selected from a well defined letters set" and put the letters "ABCDEF" as an example. Do you really want that the user can enter any letter from "A" to "Z"? Wouldn't be better to restri...
by Aacini
12 Aug 2020 05:39
Forum: DOS Batch Forum
Topic: Letter used in a variable.
Replies: 15
Views: 2928

Re: Letter used in a variable.

I think this is simpler: set "drives= ABCDEF" choice /C %drives% /N /M ">Please enter the drive letter: " set "drive=!drives:~%errorlevel%,1!" rem Check the drive here... This avoids all SET /P related problems and force the user to enter just one letter selected from a well defined letters set. Ant...
by Aacini
12 Aug 2020 05:27
Forum: DOS Batch Forum
Topic: Performance Issues with Code
Replies: 22
Views: 3571

Re: Performance Issues with Code

Which ShadowThief's solution is faster than which Antonio's solution? I wrote two solutions. The main loop in the second one is this: FOR /F "skip=1 USEBACKQ tokens=2 delims=|" %%a in ("test.txt") DO set /A "zBits|=m%%~a" It is hard to me to belive that such a loop is slower than this one: FOR /F "...