May I suggest you to test my RdRand.exe small utility to generate much better random numbers?
Antonio
Search found 1879 matches
- 28 Mar 2023 13:49
- Forum: DOS Batch Forum
- Topic: Smooth Random Numbers
- Replies: 2
- Views: 1600
- 23 Mar 2023 19:51
- Forum: DOS Batch Forum
- Topic: Read window line from parent cmd without writing to file
- Replies: 6
- Views: 2660
Re: Read window line from parent cmd
Accordingly to your last test, this should work:
Note that you changed the "backtit" ("`" character) by apostrophe...
If this not works, remove the usebackq option from FOR /F switch.
Antonio
Code: Select all
for /f "usebackq tokens=5 delims=: " %%i in ('pstat.exe ^| findstr /i "memory"') do echo %%i
If this not works, remove the usebackq option from FOR /F switch.
Antonio
- 14 Mar 2023 13:01
- Forum: DOS Batch Forum
- Topic: AUTO CONTROL+F
- Replies: 2
- Views: 1499
Re: AUTO CONTROL+F
Mmm... Is that because you have not searched for the appropriate terms perhaps?
If you want to open an application (not a file) and after that enter/input/send a key (not open the control-f), then perhaps this answer could help you...
Antonio
If you want to open an application (not a file) and after that enter/input/send a key (not open the control-f), then perhaps this answer could help you...
Antonio
- 23 Feb 2023 09:01
- Forum: DOS Batch Forum
- Topic: if else [solved]
- Replies: 2
- Views: 1623
Re: if else
Use this way:
Antonio
Code: Select all
C:\Temp> ( if not exist test.txt ( echo "not there" ) else echo "it's there" ) & echo "let's do the next things"
- 30 Jan 2023 14:58
- Forum: DOS Batch Forum
- Topic: Help with if / loop and variables
- Replies: 9
- Views: 26409
Re: Help with if / loop and variables
Ok. Let's revisit what I understand from your question: - You have a .txt file. I don't matters where and how you have such a file (if it was downloaded from the web or if it is in a hidden folder, etc.) because such details have not any influence on the solution. - The example data file is this: 12...
- 21 Jan 2023 01:20
- Forum: DOS Batch Forum
- Topic: Can't CLS during redirection - New bug or known?
- Replies: 2
- Views: 7731
Re: Can't CLS during redirection - New bug or known?
When a CLS command is redirected to a disk file, it output an ASCII 12 character, Ctrl-L called Form Feed that in most printers cause to eject current page and jump to a new page. This is a rather logical "conversion" of screen CLS command to a (paper) text file. This conversion is well-known, but I...
- 10 Jan 2023 19:01
- Forum: DOS Batch Forum
- Topic: Converting from bytes to gigabytes in multiple division statements.
- Replies: 3
- Views: 9150
Re: Converting from bytes to gigabytes in multiple division statements.
Note: 30417637376 Bytes = 28.3286 Gigabytes Let's say I want to convert 30417637376 of bytes to gigabytes. set /A "gb=30417637376/1024" The usual issue is that Command Prompt will refuse to do the division with such large number. C:\Users\Windows10>set /A "gb=30433865728/1024" Invalid number. Numbe...
- 04 Jan 2023 18:42
- Forum: DOS Batch Forum
- Topic: JREPL.BAT v8.6 - regex text processor with support for text highlighting and alternate character sets
- Replies: 550
- Views: 2010561
Re: JREPL.BAT v8.6 - regex text processor with support for text highlighting and alternate character sets
Hi, I've created a windows batch script to solve the issue below, however, it takes around 10 minutes for around 20k lines. This is too long. . . . . . Thanks in advance Too long indeed... Are you using a lot of goto commands? File append >> instead of file redirection > ? Give the following Batch ...
- 04 Jan 2023 13:23
- Forum: DOS Batch Forum
- Topic: HTA GUI build
- Replies: 5
- Views: 23629
- 03 Jan 2023 22:20
- Forum: DOS Batch Forum
- Topic: Help with if / loop and variables
- Replies: 9
- Views: 26409
Re: Help with if / loop and variables
If you can't explain with words what you want, then show it with data ... For example, put: "Giving this data file" and post an example file, "And this user input" and show us the user input, "I want this as output", accordingly... If the process is somewhat complex, show us several input and desire...
- 03 Jan 2023 22:07
- Forum: DOS Batch Forum
- Topic: how to add decimal numbers using batch file?
- Replies: 11
- Views: 39750
Re: how to add decimal numbers using batch file?
I copied the above code and adjusted it for your formula, that I think it is: result = 200 * 0.0349 + 0.49 . Here it is: @echo off setlocal EnableDelayedExpansion call :IntAsFP one=1.0000 call :IntAsFP number=200.0000 call :IntAsFP percent=0.0349 call :IntAsFP another=0.4900 set /A result=number*per...
- 18 Dec 2022 19:47
- Forum: DOS Batch Forum
- Topic: simple Batch based Tail
- Replies: 6
- Views: 9668
Re: simple Batch based Tail
. . . experimenting showed, that the lockfile removing statement wasnt called by the interpreter when written within single quotes behind the redirection operator. start cmd -c 'cd directory & nmake xyt -f makefile ^>log & del lock' it was necesary to call it after nmake finishes, so that the contr...
- 16 Dec 2022 23:53
- Forum: DOS Batch Forum
- Topic: simple Batch based Tail
- Replies: 6
- Views: 9668
Re: simple Batch based Tail
Mmmm... Ok, these are my thoughts At the very first place, your Batch file is not a Tail one! It always show all file lines . I think your Batch file would lost lines if the file is small and the forked process output lines very fast. Also, your Batch file lost any "duplicated line", that is, any li...
- 06 Dec 2022 14:11
- Forum: DOS Batch Forum
- Topic: Maze game questions
- Replies: 3
- Views: 7975
Re: Maze game questions
I invite you to review my Tetris game (the color version is here) and my VIBORAS.bat game (a multi-player version of Snake game).
Both programs makes an extensive use of "collision detection".
I hope it helps...
Antonio
Both programs makes an extensive use of "collision detection".
I hope it helps...
Antonio
- 28 Nov 2022 18:01
- Forum: DOS Batch Forum
- Topic: infinite loop with break condition
- Replies: 75
- Views: 116141
Re: infinite loop with break condition
Your idea is interesting! Use FilePointer.exe to move the file pointer of cmd.exe in order to perform a fast goto! However, you missed a very important point from FilePointer.exe documentation: Get or set the file pointer position OF A REDIRECTED FILE HANDLE. FilePointer HANDLE [position [/C|/E]] Th...