Search found 1055 matches

by jeb
21 Oct 2024 02:34
Forum: DOS Batch Forum
Topic: Progress bar
Replies: 6
Views: 24490

Re: Progress bar

And now my own try of a progress bar. But with the use of 8 different steps per single character. It shows the progress bar in the window and in the title I'm using the unicode characters from U+2588 to U+258F. ▏ ▎ ▍ ▌ ▋ ▊ ▉ █ How it looks depends on the selected font. My best results are with a uni...
by jeb
17 Oct 2024 02:05
Forum: DOS Batch Forum
Topic: How to break from a .cmd?
Replies: 2
Views: 8954

Re: How to break from a .cmd?

You can use a small function to exit only the current batch :exit-current-batch for /L %%# in (0 1 40) DO ( (goto) 2> NUL call set "_tmp=%%0" call set "_tmp=%%_tmp:~0,1%%" call set "_tmp=%%_tmp::=%%" if defined _tmp ( REM Current Batch entry found exit /b ) ) exit /b Just use CALL :exit-current-batc...
by jeb
16 Oct 2024 10:06
Forum: DOS Batch Forum
Topic: help with multilinea macro in not delayed
Replies: 4
Views: 27857

Re: help with multilinea macro in not delayed

Is it possible to bypass the endlocal barrier/tunnel inside a call of variables that have LF or in any case the code to create multiline macros? Yes. You can even make it so that it's possible to return the macro to whatever mode it was in before. The :lineReturnTest test enables delayed expansion ...
by jeb
22 Sep 2024 09:36
Forum: DOS Batch Forum
Topic: help with multilinea macro in not delayed
Replies: 4
Views: 27857

Re: help with multilinea macro in not delayed

Hi einstein1969, I don't see the relation between delayed expansion and line feeds here. Using of line feeds in macros just depends on code blocks. It is essential to use the parenthesis in the macro. rem define a line feed for using in macro definitions (Set $\n=^^^ %= this line is required =% ) se...
by jeb
13 Sep 2024 00:40
Forum: DOS Batch Forum
Topic: Observations about the tilde-dollar syntax %~$variable:I
Replies: 3
Views: 46318

Re: Observations about the tilde-dollar syntax %~$variable:I

After reading Batch: How to Properly Use CHOICE Inside of CALL Function? The problem was probably a previously set of the errorlevel variable. I was curious whether it is possible to recognize this programmatically. "if defined variableName" doesn't work here, because it's true for pseudovariables, ...
by jeb
12 Sep 2024 11:10
Forum: DOS Batch Forum
Topic: scrolling region test
Replies: 8
Views: 43838

Re: scrolling region test

Hi,

a bit nitpicking :D

new functions: :chr, :asc, :asciiMap (Fri Apr 01, 2011 10:34 pm)

I probably developed the ESC, DEL and CR (buffer overflow) technique, but the rest was just a copy and paste.

jeb
by jeb
07 Sep 2024 02:47
Forum: DOS Batch Forum
Topic: Observations about the tilde-dollar syntax %~$variable:I
Replies: 3
Views: 46318

Re: Observations about the tilde-dollar syntax %~$variable:I

1) Undefined variables and an empty variable names behave differently (#5 and #6). Perhaps an empty variable name accesses some random existing variable :?: After some more testing, I found the behavior for an empty searchPath-variable name. If you use the expression "%%~$:X" or ""%%~$====:X" the n...
by jeb
06 Sep 2024 14:28
Forum: DOS Batch Forum
Topic: Observations about the tilde-dollar syntax %~$variable:I
Replies: 3
Views: 46318

Observations about the tilde-dollar syntax %~$variable:I

I would like to share some insights about the rarely used syntax of "%~$PATH:I" %~$PATH:I Searches the directories listed in the PATH environment variable and expands %I to the fully qualified name of the first directory found. If the environment variable name isn't defined or the file isn't found b...
by jeb
07 Aug 2024 08:34
Forum: DOS Batch Forum
Topic: Scope termination and echo state
Replies: 1
Views: 18456

Re: Scope termination and echo state

Hi mataha, I don't understand why you use the "(goto) 2>nul" at all. And starting another batch file without CALL ? The (goto) construct can be used as a special EXIT with quite different behavior. (goto) works like EXIT /B, it pops the program stack and rolls back all SETLOCAL to the old state when...
by jeb
16 Jul 2024 00:59
Forum: DOS Batch Forum
Topic: Strange thing
Replies: 2
Views: 13931

Re: Strange thing

Hi miskox,

Code: Select all

for /L %%f in (1,1,78) do call set filler=%%char219%%%%filler%%
It's simply the "f" in "%%f ... iller%%"
You used %%f as your FOR-metavariable, change that or use another variable name
by jeb
15 Jul 2024 01:34
Forum: DOS Batch Forum
Topic: echo a for into a file?
Replies: 3
Views: 21822

Re: echo a for into a file?

Hi thousandsword, the problem is that all characters after the ECHO are still parsed and that results in this error. The first problem are the closing parentheses, but you can escape them with carets ( echo for /f "usebackq tokens=* delims=:" %%a in (`dir C:\myfolder\withmanyfiles\`^) do (echo File ...
by jeb
21 Jun 2024 08:47
Forum: DOS Batch Forum
Topic: Weird behavior with CALL (function)
Replies: 3
Views: 15744

Re: Weird behavior with CALL (function)

Hi,

my first guess is: You use LF as line ending instead of CRLF.
This causes such suspicious behavior.

jeb
by jeb
18 May 2024 04:45
Forum: DOS Batch Forum
Topic: IF Evaluation Values Are ECHO-Suppressed When Beginning With Colon ":". Why?
Replies: 7
Views: 12801

Re: IF Evaluation Values Are ECHO-Suppressed When Beginning With Colon ":". Why?

Hi CJM, interessting finding :D But, I don't understand why you used the prefix of: "@FOR %%$ in ($)do" This only seems to complicate things without bringing any benefit. Some of my thoughts and findings: - The echo cancellation only appears to be for ":" - The echo cancellation can be fixed by a si...
by jeb
08 Apr 2024 01:33
Forum: DOS Batch Forum
Topic: How to dynamically escape % symbols?
Replies: 4
Views: 10236

Re: How to dynamically escape % symbols?

We have automation passwords that need to be encrypted for our financial applications. We have a password generator/randomizer that we use. When % symbols are present, we need to remember to always escape them, however, a lot of the folks forget to do that. Without further description of the involv...
by jeb
18 Feb 2024 03:06
Forum: DOS Batch Forum
Topic: Automating the generation of macros usable within other macros
Replies: 4
Views: 11253

Re: Automating the generation of macros usable within other macros

Hi jfl, One side issue I'm still investigating is a good way to define a %%variable that generates a %. Using a %%p variable is easy, but this might interfere with a user-defined %%p variable. I tried using the same syntax with a caret, as for the other tricky characters: for %%^% in (1 2) do ... Th...