Search found 4525 matches

by aGerman
07 Sep 2024 04:08
Forum: DOS Batch Forum
Topic: Observations about the tilde-dollar syntax %~$variable:I
Replies: 3
Views: 36540

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

Great investigation as always, jeb!
However, you probably don't believe my first reaction when I saw the topic :lol:
Like: "Wait a second ... What the ...? I could have also used anything else but PATH in all the years that I write batch code? D'oh 🙈"
by aGerman
06 Sep 2024 10:31
Forum: DOS Batch Forum
Topic: printf.exe: Arithmetic and Programming
Replies: 31
Views: 103800

Re: printf.exe: Arithmetic and Programming

That's great. I suppose that the ESC#3 and ESC#4 change font sequences works only in Windows 11 (I have Windows 10). Unfortunately that seems to be the case. This is how it looks like in a Win 11 console. double_height_width.png The way I write assembler code is simpler and more direct, similar to C...
by aGerman
03 Sep 2024 10:04
Forum: DOS Batch Forum
Topic: printf.exe: Arithmetic and Programming
Replies: 31
Views: 103800

Re: printf.exe: Arithmetic and Programming

@Saso I thought it was about printf as you asked in this thread. However, no problem. Just create an escape character and assign it to a variable as you already know: for /f %%i in ('echo prompt $E^|cmd') do set "ESC=%%i" echo %ESC%#3 Some text - displayed with double height and double width. echo %...
by aGerman
02 Sep 2024 12:49
Forum: DOS Batch Forum
Topic: printf.exe: Arithmetic and Programming
Replies: 31
Views: 103800

Re: printf.exe: Arithmetic and Programming

Works for me, Saso. printf "%c#3Double Height (implies Double Width)\n%c#4Double Height (implies Double Width)\n" 27 27 Tested in the prompt of Windows Terminal. In a batch script you have to double the percent signs as always. And I think to make it also work in a console window, Antonio would have...
by aGerman
27 Aug 2024 11:50
Forum: DOS Batch Forum
Topic: Docs: GOTO Bug Clarification
Replies: 3
Views: 13106

Re: Docs: GOTO Bug Clarification

Yeah, to be clear - SS64 is a pretty good reference. The official MS docs don't tell you about such effects of GOTO. However, I still think that "bug" is the wrong wording here. Just an example of how I understand it: @echo off goto label&echo FOO :label echo BAR pause FOO is never printed as the GO...
by aGerman
27 Aug 2024 09:29
Forum: DOS Batch Forum
Topic: Execute filename as a comand
Replies: 1
Views: 3620

Re: Execute filename as a comand

Fortunately you have to use %~n0 in your example. Similarly, it's already been the source for headaches of a lot of people whenever they named the script file the same as any command used in the code :lol:

Steffen
by aGerman
27 Aug 2024 09:16
Forum: DOS Batch Forum
Topic: Docs: GOTO Bug Clarification
Replies: 3
Views: 13106

Re: Docs: GOTO Bug Clarification

SS64 is for sure not the official docs. So you may ask the author of the site to disambiguate their statement.
IMO it refers to & and && following a GOTO command. However, I would consider this to be expected behavior rather than a bug.

Steffen
by aGerman
24 Aug 2024 05:41
Forum: DOS Batch Forum
Topic: Batch file question
Replies: 2
Views: 22678

Re: Batch file question

I'm not entirely sure what your expectation is.
In your second example the folder E:\Dir is backed up into the root of G: as you specified. /MIR implies /PURGE which deletes all directories that are not in the source. So what do you think should have happened instead?

Steffen
by aGerman
10 Aug 2024 08:46
Forum: DOS Batch Forum
Topic: "TermStrWidth" utility – measure the number of cells a string occupies in the CLI.
Replies: 2
Views: 8352

Re: "TermStrWidth" utility – measure the number of cells a string occupies in the CLI.

Thanks Saso! As this is about predicting the appearance of strings I should have provided some examples and screenshots. So in the attached zip is a little code where the pictures below are based on. Tested on Win 11. The font is Cascadia Code. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
by aGerman
10 Aug 2024 04:30
Forum: DOS Batch Forum
Topic: string manipulation, display a whole line or cut and display the part
Replies: 3
Views: 11040

Re: string manipulation, display a whole line or cut and display the part

is there a way to make 69 as a variable manipulation without introducing a new variable? No. FWIW in your initial post you wrote "if the line is less than 70". Was that meant to be "<= 70" rather than "< 70"? %DS2%-1 didnt work inside !!, just for my learning purpose Because SET /A is for calculati...
by aGerman
09 Aug 2024 09:26
Forum: DOS Batch Forum
Topic: string manipulation, display a whole line or cut and display the part
Replies: 3
Views: 11040

Re: string manipulation, display a whole line or cut and display the part

Not tested:

Code: Select all

   if "!VV:~0,69!"=="!VV!" (
     echo !DD! !VV!
   ) else (
     echo !DD! !VV:~%DS%,%DS2%!
   )
Note that you have to update your DS2 value to 45 as it defines the number of characters after DS1.

Steffen
by aGerman
06 Aug 2024 16:09
Forum: DOS Batch Forum
Topic: "TermStrWidth" utility – measure the number of cells a string occupies in the CLI.
Replies: 2
Views: 8352

"TermStrWidth" utility – measure the number of cells a string occupies in the CLI.

What? This little tool measures the display width of strings in the Windows Terminal / Console. It is basically a copy of the recently revised code for this purpose in Microsoft's open source repository. All credits go to their Terminal team. I used this code in order to actually get the same result...
by aGerman
31 Jul 2024 11:00
Forum: DOS Batch Forum
Topic: Reduced-Flicker in dos batch. It's possible?
Replies: 40
Views: 94945

Re: Reduced-Flicker in dos batch. It's possible?

No attempt happened to work for me so far. Not even the most recent code. And it doesn't matter what settings I update, what processes are running or not running, whether I test in terminal or console ... So, I doubt it being worth investigating any further as also Win 8.1 is now a walking dead sinc...
by aGerman
23 Jul 2024 12:42
Forum: DOS Batch Forum
Topic: non-buffering FOR /F alternative
Replies: 9
Views: 48947

Re: non-buffering FOR /F alternative

I don't think this is applicable in my specific case. The tool I've been talking about is event-driven. The lines it writes contain the relative path of the object in the file system that triggered the event. So, each line it outputs has a another length and it's quite unlikely they are even close t...
by aGerman
17 Jul 2024 10:00
Forum: DOS Batch Forum
Topic: Problems using parameters in a STARTed Batch file
Replies: 10
Views: 28600

Re: Problems using parameters in a STARTed Batch file

For sure not because of a single smiley :lol: It may still take a veeeery long time before we get close to the theoretical limit of 1114112 assigned Unicode code points. The majority is still not assigned. However, this number is 4352 times as many as conceivable in a single-byte encoding. Just to g...