Search found 1625 matches

by Aacini
04 Apr 2020 12:01
Forum: DOS Batch Forum
Topic: Make cmd.exe parse piped batch code
Replies: 2
Views: 168

Re: Make cmd.exe parse piped batch code

All the differences between "execute a batch script" vs. "execute command lines piped/redirected to cmd.exe" are described with detail at this thread.

Antonio
by Aacini
17 Mar 2020 15:40
Forum: DOS Batch Forum
Topic: @Echo off is not working when Piping batch code to cmd
Replies: 8
Views: 396

Re: @Echo off is not working when Piping batch code to cmd

The simplest way is via the cmd /Q trick, but this don't omits the initial text. You may review other differences in the code executed via a .BAT batch file vs. via text redirected into cmd.exe at cmd.exe < NotBatch.txt file topic. For example: - @ECHO OFF command just supresses the echoing of the p...
by Aacini
13 Mar 2020 02:00
Forum: DOS Batch Forum
Topic: Get line with highest numerical string
Replies: 6
Views: 409

Re: Get line with highest numerical string

This works:

Code: Select all

@echo off
setlocal EnableDelayedExpansion

set lastNum=0

for /F "delims=" %%a in ('findstr "outbox/logs/" test.txt') do (
   set "a=%%~Na"
   for %%b in ("!a:_=.!") do set "num=%%~Xb"
   if !num:~1! gtr !lastNum! set "lastNum=!num:~1!" & set "lastLine=%%a"
)

echo %lastLine%
by Aacini
02 Mar 2020 11:06
Forum: DOS Batch Forum
Topic: If Statement for Text Not Working
Replies: 2
Views: 1001

Re: If Statement for Text Not Working

In this line you entered a space between the last character and the & command separator: set tempstr=%LOCAL_FILE_DIR:~-1% & rem Get last character in string. right here: ^ ... so tempstr contains "t+space" and when you compare: if "%tempstr%" == "t" ( it is NOT true... In order to avoid this type of...
by Aacini
24 Jan 2020 09:39
Forum: DOS Batch Forum
Topic: Ultimate MSDOS interactive dynamic menu with Powershell quirk
Replies: 1
Views: 1260

Re: Ultimate MSDOS interactive dynamic menu with Powershell quirk

scavenger wrote:
20 Jan 2020 00:33

This batch is dedicated to @Aacini, one of the greatest MSDOS geniuses around 8)
:D :wink: :mrgreen:
by Aacini
12 Dec 2019 11:45
Forum: DOS Batch Forum
Topic: The most primitive XML writer (just for fun)
Replies: 7
Views: 1491

Re: The most primitive XML writer (just for fun)

siberia-man wrote:
11 Dec 2019 03:49
.....
I presume there could be a lot of complexity to be never developed because of batch syntax limitation.
Perhaps you could be interested in my TextToHtml.bat conversion program with a lot of features...

Antonio
by Aacini
06 Dec 2019 07:14
Forum: DOS Batch Forum
Topic: A dual Batch+CSS script to convert Markdown to HTML
Replies: 4
Views: 1243

Re: A dual Batch+CSS script to convert Markdown to HTML

This remembers me my old TextToHtml.bat program that converts a BBCode-style text file into a HTML complete page although it is not an hybrid program, but a pure Batch file...

Antonio
by Aacini
06 Dec 2019 06:37
Forum: DOS Batch Forum
Topic: CmdRunner - 3d game (CubeRunner clone)
Replies: 44
Views: 13465

Re: CmdRunner - 3d game (CubeRunner clone)

si se puede romper un bucle For /l @echo off @title rompiendo bucle :main for /L in (0,1,990) do ( if "%%A"=="50" (goto :salirLoop) cls echo. EL BUCLE TERMINADA EN : 50 echo. %%A ) goto :main :salirLoop echo. salio del bucle pause cls exit goto :salirLoop The short answer is No. The loop continues ...
by Aacini
21 Nov 2019 05:51
Forum: DOS Batch Forum
Topic: NEWBIE HERE :)
Replies: 3
Views: 1212

Re: NEWBIE HERE :)

Perhaps you would like to review my Tetris game, or its Tetris in color version, or my Viboras.bat in color version of snake game...

Antonio
by Aacini
20 Nov 2019 00:05
Forum: DOS Batch Forum
Topic: Employee clock in / clock out .bat
Replies: 10
Views: 1675

Re: Employee clock in / clock out .bat

Perhaps this answer may help you...

Antonio
by Aacini
30 Oct 2019 06:47
Forum: DOS Batch Forum
Topic: help for command
Replies: 5
Views: 3700

Re: help for command

So your question is intended just for people that know Unix, right?

Sorry, but I don't know Unix. Perhaps if I could see what is the result you want, I could write a Batch script for that...

Or you may post this request on a Unix forum.

Antonio
by Aacini
09 Oct 2019 10:30
Forum: DOS Batch Forum
Topic: Remove Microsoft header from cmd, for example when executing code from alternate data stream
Replies: 10
Views: 10168

Re: Remove Microsoft header from cmd when executing code from alternative data stream

Mmmm... A couple remarks about your post... In first place, your problem is not related to Alternate Data Streams. The same effect happen when you redirect any text file into cmd.exe in that way. The simplest way to avoid the initial cmd.exe message is using this format: cmd /d /q < %adsfile%:test1 ...
by Aacini
07 Oct 2019 11:54
Forum: DOS Batch Forum
Topic: [SOLVED] If one of two files exist then do something.
Replies: 18
Views: 13234

Re: If one of two files exist then do something.

You don't need the auxiliary f3 variable; just ask for %bitset% less than 4 to know if File3.exe is missing. You may also do some simplifications: set /A bitset=0, bit=1 for %%f in (File1.exe File2.exe File3.exe) do ( if exist "%userprofile%\Desktop\%%f" set /A "bitset|=bit" set /A "bit<<=1" ) if %b...
by Aacini
19 Sep 2019 02:13
Forum: DOS Batch Forum
Topic: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appearance]
Replies: 10
Views: 8660

Re: [Resolved] For loop to do something with all variables beginning with a string [also find variables order of appeara

You may achieve the same result in simpler ways. For example: @echo off setlocal enabledelayedexpansion rem Below there is a method to define variables by putting them in a FOR command. rem Optionally you may also define a list of variables this way: rem set values="example-one=value" "example-two=v...