Search found 954 matches

by jeb
07 Apr 2020 23:09
Forum: DOS Batch Forum
Topic: can you do this batch ocrrectly for me please
Replies: 4
Views: 42

Re: can you do this batch ocrrectly for me please

Hi, you should check, that there is no ping.bat in your working directory, else it will be infinitely repeated, because "ping 66.151.33.4 -t" will call the batch file "ping.bat" not the ping.exe command. Your other problem is the character encoding of "Conexión de red inalámbrica". You got the error...
by jeb
07 Apr 2020 05:25
Forum: DOS Batch Forum
Topic: can you do this batch ocrrectly for me please
Replies: 4
Views: 42

Re: can you do this batch ocrrectly for me please

Hi abuchaibe3, first your problem with "ping 66.151.33.4 -t" if i dont save it as .bat with notepad, but if i do that the command doesn't stop repeating I guess, you save it as "ping.bat" ? If yes, think about it a minute and you will find the problem. Your first problem occurs probably from your ut...
by jeb
07 Apr 2020 00:00
Forum: DOS Batch Forum
Topic: Special Characters contained in Variable used in String:Replace command...
Replies: 1
Views: 19

Re: Special Characters contained in Variable used in String:Replace command...

Hi Arianax, simple: You can't :!: It's not possible to escape an equal sign in the search string. There exist some pure batch solutions (also on Dostips), but I would recommend the easy to use and powerful solution from Dave JREPL . This is a JScript/Batch hybrid from one of our honored, expert memb...
by jeb
02 Apr 2020 02:41
Forum: DOS Batch Forum
Topic: Echoing variables with colouring problem for filenames or directories
Replies: 2
Views: 72

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: 120

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: 93

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: 254

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: 396

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: 396

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: 379

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: 7141

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: 3947

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: 3947

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: 3947

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: 3947

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...