Search found 1609 matches

by Aacini
12 Sep 2019 11:13
Forum: DOS Batch Forum
Topic: ProgramA closes and ProgramB closes automatically
Replies: 3
Views: 127

Re: ProgramA closes and ProgramB closes automatically

Try: @echo off start "" "C:\Users\Viktor\Documents\FreeFileSync Auftraege\RealTimeSync Auftraege\RealTime_(.minecraft-GoogleDrive)_[Mirror].ffs_real" start "" "C:\Users\Viktor\Documents\FreeFileSync Auftraege\RealTimeSync Auftraege\RealTime_(.minecraft-Backupfolder)_[Mirror].ffs_real" ( start "" "C:...
by Aacini
05 Sep 2019 05:14
Forum: DOS Batch Forum
Topic: rename files in a directory in a batch
Replies: 3
Views: 219

Re: rename files in a directory in a batch

Your problem description is confusing an incomplete. You should describe the problem using plain English instead of examples or code segments. If a real filename does not match the examples shown, the method may fail. The code segments may lead to wrong assumptions. For example, I don't know Foxpro,...
by Aacini
04 Sep 2019 15:55
Forum: DOS Batch Forum
Topic: Send certutil output directly to a variable instead of file, and then finally copy to clipboard?
Replies: 6
Views: 1586

Re: Send certutil output directly to a variable instead of file, and then finally copy to clipboard?

I prefer the redirection < syntax because it is more efficient. The | pipe requires the execution of two additional copies of cmd.exe

Antonio
by Aacini
04 Sep 2019 15:48
Forum: DOS Batch Forum
Topic: Batch script to remove duplicate rows while ignoring first few characters
Replies: 3
Views: 219

Re: Batch script to remove duplicate rows while ignoring first few characters

Code: Select all

@echo off
setlocal DisableDelayedExpansion

(for /F "tokens=1* delims=_" %%a in (input.txt) do (
   if not defined key["%%b"] (
      set key["%%b"]=1
      echo %%a_%%b
   )
)) > output.txt
Antonio
by Aacini
01 Sep 2019 11:07
Forum: DOS Batch Forum
Topic: Multi-line menu with options selection via DOSKEY
Replies: 15
Views: 7548

Re: Multi-line menu with options selection via DOSKEY

@Aacini I found a strange thing lately,with this script: @echo off :null PowerShell Exit($host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown').VirtualKeyCode); echo %errorlevel% goto null this can detect arrow keys, but only as %&'( (key 37,38,39,40) So far this is the closest thing I could find for arro...
by Aacini
30 Aug 2019 13:07
Forum: DOS Batch Forum
Topic: Bit Twiddling Hacks in Batch
Replies: 6
Views: 556

Re: Bit Twiddling Hacks in Batch

Mmmm... These are my thoughts... Binary numbers and binary arithmetic is a tool that allows to perform arithmetic operations in a much efficient way than decimal operations, so is the right tool when speed is important in an application. Binary numeral system also allows to solve a problem in a much...
by Aacini
18 Aug 2019 04:53
Forum: DOS Batch Forum
Topic: Multi-line menu with options selection via DOSKEY
Replies: 15
Views: 7548

Re: Multi-line menu with options selection via DOSKEY

@Szecska, As I said before , you may get the same result in a much simpler way using a choice /N /C 123450 command; I don't see any reason to use the replace.exe method here... IMHO these replace.exe-based examples should be moved to the replace.exe explanation method thread. Those "option selection...
by Aacini
09 Aug 2019 20:37
Forum: DOS Batch Forum
Topic: SORT Order not working correction
Replies: 8
Views: 2407

Re: SORT Order not working correction

Are you using SORT not for sorting, but to get maximum and minimum? And two times ? :shock: Strange thing... Why not keep things simple? Try: @echo off setlocal set /A max=-99999, min=99999 for /F "usebackq tokens=5,6 delims=|" %%a in ("%%~F") do ( if %%a gtr !max! set "max=%%a" if %%a lss !min! set...
by Aacini
09 Aug 2019 08:19
Forum: DOS Batch Forum
Topic: Find, replace and move rows with matches and mismatches
Replies: 4
Views: 1382

Re: Find, replace and move rows with matches and mismatches

This new version should run faster: @echo off setlocal EnableDelayedExpansion rem Load strings to search from parameters (modify this point if required) set n=0 for %%a in (%*) do ( set /A n+=1 set "S!n!=%%a" ) (for /F "tokens=1* delims=," %%a in (input.txt) do ( set "this=%%a" & set "rest=%%b" set ...
by Aacini
09 Aug 2019 07:08
Forum: DOS Batch Forum
Topic: SORT Order not working correction
Replies: 8
Views: 2407

Re: SORT Order not working correction

Of course! SORT command sorts lines . In other words, sorts strings , and AC_41110|FH_00000|DP_000|CO_11|9|FY19|budget|-3477456.18 string is "larger" (that is, goes after) than AC_41110|FH_00000|DP_000|CO_11|12|FY19|budget|-2968880.0 string (because the "9" is larger than the "1"). Antonio
by Aacini
07 Aug 2019 22:53
Forum: DOS Batch Forum
Topic: Find, replace and move rows with matches and mismatches
Replies: 4
Views: 1382

Re: Find, replace and move rows with matches and mismatches

Your "question" (a task request, really) have a lot of confusing or incomplete details. I strongly suggest you to carefully read the first sticky post of this forum... However, this code works: @echo off setlocal EnableDelayedExpansion set n=0 for /F "delims=" %%a in (input.txt) do ( set /A n+=1, i=...
by Aacini
11 Jul 2019 22:15
Forum: DOS Batch Forum
Topic: Multi-line menu with options selection via DOSKEY
Replies: 15
Views: 7548

Re: Multi-line menu with options selection via DOSKEY

I reviewed this program and fixed the problem about the reinitialization of DOSKEY history. It works correctly now. Then, I wrote an example of a menu to start real programs. When the programs are console applications, everything is OK. However, when the programs are GUI applications, then may be a ...
by Aacini
28 Jun 2019 12:15
Forum: DOS Batch Forum
Topic: Cmdgfx - draw 3d and graphic primitives (polygons,circles etc) in cmd window (now with 24-bit RGB support!)
Replies: 105
Views: 39645

Re: Cmdgfx - draw 3d and graphic primitives (polygons,circles etc) in cmd window (now with 24-bit RGB support!)

Wow! The writing of text is fantastic! This remembers me my old method to write text in pixel mode. Where do you get the definition of the raster fonts, so you can read them?

Antonio
by Aacini
21 Jun 2019 15:27
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 440
Views: 203573

Re: JREPL.BAT v8.2 - regex text processor with support for text highlighting and alternate character sets

Mmmm... If you may change the format of both input files, then there is a very simple solution: target.txt: There is !a! apple Now there were !b! apples before In the beginning there were !c! apples definition.txt: a=one b=two c=three test.bat: @echo off setlocal EnableDelayedExpansion rem Read stri...
by Aacini
05 Jun 2019 08:54
Forum: DOS Batch Forum
Topic: Batch file runs differently when executed line by line
Replies: 6
Views: 1913

Re: Batch file runs differently when executed line by line

At this topic there is a detailed description of the differences of execute commands inside a Batch.bat file vs directly at the command line. Perhaps you may want to review it, but be warned that such a topic quickly changes into an esoteric subject! :shock: :wink:

Antonio