Search found 951 matches

by jeb
02 Apr 2020 02:41
Forum: DOS Batch Forum
Topic: Echoing variables with colouring problem for filenames or directories
Replies: 2
Views: 41

Re: Echoing variables with colouring problem for filenames or directories

Hi stevehero, most of my code is more or less only a proof of concept :!: The color sample, too. Long time ago, I developed it to show that it's even possible to colorize characters. But to use it as a function, you better switch to the code of Dave SO: How to have multiple colors in a Windows batch...
by jeb
29 Mar 2020 22:52
Forum: DOS Batch Forum
Topic: % in file list causing issues with call :command
Replies: 4
Views: 83

Re: % in file list causing issues with call :command

Hi stevehero, the problem is the call command, it starts a second round of parsing, therefore the percent is interpreted and eventually removed. It's better to assign "%%~fG" to a variable, and later, use that variable. @For /F "UseBackDelims=" %%G In ("%Temp%\music-checker-list-2020-03-29_2034-21.t...
by jeb
27 Mar 2020 07:45
Forum: DOS Batch Forum
Topic: Find and resume task/process in cmd over ssh
Replies: 1
Views: 68

Re: Find and resume task/process in cmd over ssh

Hi, there are some questions left. You are using a windows on both computers, but you are also using ssh to connect from one computer to the other. I'm assume, you have installed something like OpenSSH on one computer (server) and connect by using putty or openssh. But in both cases, I would expect ...
by jeb
20 Mar 2020 04:25
Forum: DOS Batch Forum
Topic: 8191 buffer limit: Different Windows 10 builds behave differently
Replies: 5
Views: 207

Re: 8191 buffer limit: Different Windows 10 builds behave differently

Hi Dave, good idea to use the time ... So I had planned to run a series of tests to investigate all of the above. But I didn't get very far because I am seeing surprising differences between two machines with different versions of Windows 10 :shock: :? 1) Differences I knew this, but I didn't found ...
by jeb
16 Mar 2020 04:22
Forum: DOS Batch Forum
Topic: @Echo off is not working when Piping batch code to cmd
Replies: 8
Views: 345

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

If you are on windows10 with ansi escape sequences enabled, you can use some magic to hide the commands. cmd /Q /v:on /k for /F "delims=#" %a in ('"prompt #$E# & for %a in (1) do rem"') do set "ESC=%a" & echo off <nul set /p ".=%ESC%[G%ESC%[2K%ESC%%ESC%[A%ESC%[2K" echo #1 echo #2 echo #3 echo !time!...
by jeb
16 Mar 2020 01:16
Forum: DOS Batch Forum
Topic: @Echo off is not working when Piping batch code to cmd
Replies: 8
Views: 345

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

Hi BoQs, If only there were no requirement to prefix every command with echo this would be perfect. There is no need for the ECHO prefix of each line, it's only necessary in your example. You can download and start a simple script with a pipe. Test.bat @echo off ( cls echo Hello echo Time: !time! ex...
by jeb
11 Mar 2020 02:59
Forum: DOS Batch Forum
Topic: Simple String Problem
Replies: 2
Views: 346

Re: Simple String Problem

Hi rana, it's a problem of your code formatting. In batch you can't use spaces in a SET expression, without side effects. The correct syntax is SET var=content or even better, to protect against invisible trailing white spaces SET "var=content" You used set ab = Batch , this sets a variable with the...
by jeb
25 Feb 2020 07:41
Forum: DOS Batch Forum
Topic: help - replace multiple strings from a file in another file
Replies: 11
Views: 7113

Re: help - replace multiple strings from a file in another file

Without seeing the relevant part of your replace code it's hard to say ....

There shouldn't be any problems with delayed expansion.

Code: Select all

set "line=!line:%%Y_dossier%%=%%Z_dossier%%!"
set "line=!line:&=...et...!"
echo(!line!
by jeb
20 Feb 2020 09:02
Forum: DOS Batch Forum
Topic: Query States using Console Virtual Terminal Sequences.
Replies: 12
Views: 3924

Re: Query States using Console Virtual Terminal Sequences.

Tested on a linux system.

There the cpr is appended as expected and it has no other priority than user input.
by jeb
20 Feb 2020 08:50
Forum: DOS Batch Forum
Topic: Query States using Console Virtual Terminal Sequences.
Replies: 12
Views: 3924

Re: Query States using Console Virtual Terminal Sequences.

I was pleasantly surprised that the position query cleared the input buffer before inserting the position response No, the position query doesn't clear the input buffer. :shock: BUT it inserts the response at the beginning of the buffer instead of appending it :?: for /F "delims=#" %%a in ('"prompt...
by jeb
19 Feb 2020 15:30
Forum: DOS Batch Forum
Topic: Query States using Console Virtual Terminal Sequences.
Replies: 12
Views: 3924

Re: Query States using Console Virtual Terminal Sequences.

:shock: Holy smokes! Nice work! I never expected to see a solution for reading the cursor position with pure batch. I can see this being genuinely useful, although I wish it were faster. You should update your old answer at https://stackoverflow.com/a/38240300/1012053 so I can then accept it. :) Ho...
by jeb
19 Feb 2020 09:36
Forum: DOS Batch Forum
Topic: Query States using Console Virtual Terminal Sequences.
Replies: 12
Views: 3924

Re: Query States using Console Virtual Terminal Sequences.

One more test to fetch the cursor report with an unexpected result 8) :!: @echo off FOR /F "tokens=3 delims=:" %%L in ("%~0") DO goto :%%L REM *** Save Cursor Position in Memory <nul set /p "=%\e%7" REM *** Bring the cursor to x,y=20,20 <nul set /p "=%\e%[20;20H" REM *** Request Cursor report <nul s...
by jeb
17 Feb 2020 06:22
Forum: DOS Batch Forum
Topic: Query States using Console Virtual Terminal Sequences.
Replies: 12
Views: 3924

Re: Query States using Console Virtual Terminal Sequences.

Probably I should have used REPLACE instead of XCOPY.
Replace echos the input character on a separate line

Then the fetch part is

Code: Select all

set "char=;"
for /F "tokens=1 skip=1 delims=*" %%C in ('"REPLACE /W ? . < con"') DO (
	set "char=%%C"
)
by jeb
17 Feb 2020 04:00
Forum: DOS Batch Forum
Topic: Bug in vt101 Alternate Screen Buffer?
Replies: 7
Views: 2740

Re: Bug in vt101 Alternate Screen Buffer?

aGerman wrote:
17 Feb 2020 03:50
Your Win10 version is outdated since end of 2018 though.
Thanks, didn't know that. But the updates are controlled by the company.

For my own computers there isn't such a problem.
The last windows I used was Win7, after that I'm only using linux.

jeb
by jeb
17 Feb 2020 01:36
Forum: DOS Batch Forum
Topic: Bug in vt101 Alternate Screen Buffer?
Replies: 7
Views: 2740

Bug in vt101 Alternate Screen Buffer?

Hi, my win10 crashes reproducible by leaving the alternate screen buffer . :( The alternate screen could be useful for switching between different outputs or for games, because it doesn't support scrolling/scrollbars. My first crash sample, but only when I ask for user input. @echo off setlocal for ...