Search found 243 matches

by T3RRY
14 Nov 2021 04:44
Forum: DOS Batch Forum
Topic: Limiting echo & Output word "on"
Replies: 6
Views: 4408

Re: Limiting echo

1. How to limit what echo is to process, without splitting the line? example Prompt:>if 2 GTR 1 echo bigger else echo lesser result: bigger else echo lesser 2. How to echo "ON" instead of turning echo on? Your problem is not with echo, it's with your failure to use correct If else syntax: if ( comm...
by T3RRY
29 Oct 2021 23:01
Forum: DOS Batch Forum
Topic: Live coundown timer
Replies: 10
Views: 5870

Re: Live coundown timer

drgt wrote:
29 Oct 2021 13:11
xp sp2!
Information like this is useful to provide when asking a question.

An alternative to timeout for you to try:

Code: Select all

start "" /w /b /min mshta "javascript:setTimeout(function(){close();},1000);"
by T3RRY
29 Oct 2021 12:37
Forum: DOS Batch Forum
Topic: Live coundown timer
Replies: 10
Views: 5870

Re: Live coundown timer

yes, this is easily possible, however, more information regarding the use case would be helpful. IE: does it matter if the timer is script blocking, or do you want to just show a timer while the script is executing something else? An example of a no frills timer that blocks script execution: @ECHO o...
by T3RRY
24 Sep 2021 04:10
Forum: DOS Batch Forum
Topic: Best way to pull out specifc lines from text file? JREPL?
Replies: 6
Views: 5597

Re: Best way to pull out specifc lines from text file? JREPL?

I wonder "Where the trivial PS code is?" :shock: IMHO in this type of answers the poster should warn: "This PS solution is more difficult and convoluted than a Batch file, but here it is anyway"... :? Antonio Sorry Antonio, but I fail to see what's not trivial about using regex to match desired pat...
by T3RRY
23 Sep 2021 09:24
Forum: DOS Batch Forum
Topic: Best way to pull out specifc lines from text file? JREPL?
Replies: 6
Views: 5597

Re: Best way to pull out specifc lines from text file? JREPL?

If using powershell commands via batch is an option, this becomes very trivial thanks to regex. :# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_regular_expressions?view=powershell-7.1 @Echo off & CD /d "%~dp0" Set "File=%~dp0input.txt" %= Replace with actu...
by T3RRY
21 Sep 2021 11:34
Forum: DOS Batch Forum
Topic: Can we capture the response of a terminal?
Replies: 3
Views: 3859

Re: Can we capture the response of a terminal?

aGerman wrote:
21 Sep 2021 11:28
Thanks T3RRY! I din't recognize that this thread is a dup of viewtopic.php?t=9454 :lol:

Steffen
No worries, Just glad I remebered something for once.
by T3RRY
21 Sep 2021 11:20
Forum: DOS Batch Forum
Topic: Can we capture the response of a terminal?
Replies: 3
Views: 3859

Re: Can we capture the response of a terminal?

There are control sequences that you can send to a virtual terminal emulator to request certain information. The response is written to the stdin which seems to make it quite difficult to read it in a Batch code. The example below is a small code which demonstrates what I'm talking about all along....
by T3RRY
18 Sep 2021 09:50
Forum: DOS Batch Forum
Topic: Array construction with empty value
Replies: 9
Views: 6954

Re: Array construction with empty value

Found a couple old threads and this is what I came up with: @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION FOR %%a IN ( "FDR|DLR_DATA_FDRII,DLR_DATA_FDRII|inbox/LOC_DATA_FDRII||STORE_DATA" ) DO FOR /F "eol=' delims=" %%G IN ("%%a") DO ( SET "L=%%~G" REM add a backslash (or other character) in front of e...
by T3RRY
18 Sep 2021 08:47
Forum: DOS Batch Forum
Topic: Array construction with empty value
Replies: 9
Views: 6954

Re: Array construction with empty value

Hi Folks - This may be a stupid question. I have the following array: FOR %%a IN ( "FDR|DLR_DATA_FDRII,DLR_DATA_FDRII|inbox/LOC_DATA_FDRII|REPLACE|STORE_DATA" ) DO FOR /F "tokens=1-4 delims=|" %%A IN (%%a) DO ( SET "STR[%%A].DLR=%%B" SET "STR[%%A].LOC=%%C" SET "STR[%%A].IMP=%%D" SET "STR[%%A].EXP=%...
by T3RRY
17 Sep 2021 13:33
Forum: DOS Batch Forum
Topic: [How-To] Get or set the console font size and font name (PowerShell hybrid)
Replies: 3
Views: 5331

Re: [How-To] Get or set the console font size and font name (PowerShell hybrid)

Hi! I love this, and I'd love to use it. Trying to tinker with it, but I don't know Powershell! Can you help me? Typically I run my scripts in raster fonts 8x8. It's nice to have a nice square character to draw shapes and run animation. Using %setfont%, I haven't been able to achieve it. I can get ...
by T3RRY
13 Sep 2021 06:34
Forum: DOS Batch Forum
Topic: Question with Array setup
Replies: 12
Views: 8138

Re: Question with Array setup

Thanks, T! Where would I add that character? To the array itself when it initializes? Change the logic a bit in the mask / _Check setion to make use of the variables ] as the terminating character. (Untested): CALL SET "MASK=%%FILENAME:~0,%%A%%]" CALL SET "_CHECK=%%STR[!MASK!.DLR%%" If defined _CHE...
by T3RRY
13 Sep 2021 03:05
Forum: DOS Batch Forum
Topic: Question with Array setup
Replies: 12
Views: 8138

Re: Question with Array setup

Hi Folks - I have a unique situation that I'm wondering how to solve. I have an array and i'm initializing as follows: FOR %%a IN ( "FDR|DLR_DATA_FDRII,DLR_DATA_FDRII|inbox/LOC_DATA_FDRII|REPLACE|STORE_DATA" "FDRBS|DLR_DATA_FDRII,DLR_DATA_FDRII|inbox/LOC_DATA_FDRII|REPLACE|STORE_DATA" "FDRCS|DLR_DA...
by T3RRY
06 Sep 2021 06:24
Forum: DOS Batch Forum
Topic: proof of concept: alternate asynchronous non-blocking input
Replies: 7
Views: 7950

Re: proof of concept: alternate asynchronous non-blocking input

for a Little bit asyncron mode more @echo off setlocal title :,0," if /I {%1}=={input} goto input if /I {%1}=={output} goto output rem use TAB to EXIT for /f "delims= " %%T in ('robocopy /L . . /njh /njs' )do set "TAB=%%T" set "title=1234567890987654321" title %title% for /f "tokens=2delims=," %%i ...
by T3RRY
05 Sep 2021 12:12
Forum: DOS Batch Forum
Topic: How to return ascii value in 'bg _Kbd'
Replies: 9
Views: 6501

Re: How to return ascii value in 'bg _Kbd'

@aGerman I have. On this post (https://www.dostips.com/forum/viewtopic.php?t=4094) it states there is an option called "_Kbd" to wait until a key was pressed. @penpen The reason I'm using _Kbd is to wait 3 seconds to give you time to press a key, The issue with Kbd is you have to press a key instea...
by T3RRY
04 Sep 2021 21:31
Forum: DOS Batch Forum
Topic: How to return ascii value in 'bg _Kbd'
Replies: 9
Views: 6501

Re: How to return ascii value in 'bg _Kbd'

using timeout after bg.exe is resulting in the errorlevel returning to 0. Store or assess the returned errorlevel before enacting other commands. Note : the latest version of Carlos' Batch Graphics, including full documentation, can be found at https://github.com/carlos-montiers/consolesoft-mirror/t...