Search found 1041 matches

by jeb
19 May 2021 00:31
Forum: DOS Batch Forum
Topic: Batch coloring not working after git output
Replies: 2
Views: 2967

Re: Batch coloring not working after git output

Hallo Bleifuss,

I just tested it on Win10 and it worked,
but I'm sure I saw a similar post about broken escape sequences after some commands.
But as always I can't find the post anymore.

jeb
by jeb
12 Apr 2021 09:17
Forum: DOS Batch Forum
Topic: MS-DOS 6.22 variable trimming
Replies: 3
Views: 4122

Re: MS-DOS 6.22 variable trimming

After review your original problem, I see it's considerably easier, because the output of your program can be used directly. I assume, the output always begins with "CPU_0" You only need two files (GETCPUID.bat and ADD.BAT) GETCPUID.bat @echo off REM Trampoline function for %%L in (%0) do if "%%L"==...
by jeb
02 Apr 2021 06:23
Forum: DOS Batch Forum
Topic: MS-DOS 6.22 variable trimming
Replies: 3
Views: 4122

Re: MS-DOS 6.22 variable trimming

Hi cajunjon, you could split your problem into smaller problems and use some helper files. The list of your problems You need to assign the program output to a variable Split a string into parts substring works only for strings without spaces or other delimiters A variable can't contain an equal sig...
by jeb
19 Feb 2021 01:46
Forum: DOS Batch Forum
Topic: Apostrophe at beginning of file name
Replies: 6
Views: 6061

Re: Apostrophe at beginning of file name

Hi, the error occurs after the file was read, because the FOR loop tries to read the next file! @echo off echo this is myfile>myfile.txt echo this is myapo> "'myapo.txt" echo this is myapo1> "'myapo1.txt" for /F "usebackq delims=" %%G IN ("'myapo.txt" "myfile.txt" ) do echo #1 %%G for /F "usebackq d...
by jeb
17 Feb 2021 03:30
Forum: DOS Batch Forum
Topic: Problem with variable Drive setup for XP/W98SE
Replies: 18
Views: 19765

Re: Problem with variable Drive setup for XP/W98SE

Hi miskox, echo %cd% tested, it works in XP, but not in w98. That was expected, because XP has nearly the same features and bugs like W10. It could be a good solution to write different code for XP and W98 and detect which part has to be used. Something like @echo off >NUL echo dummy & goto :XP REM ...
by jeb
16 Feb 2021 06:00
Forum: DOS Batch Forum
Topic: Problem with variable Drive setup for XP/W98SE
Replies: 18
Views: 19765

Re: Problem with variable Drive setup for XP/W98SE

You could try this one, it works on win98 (tested) and should work on XP, too @echo off if "%1" == "" goto :main goto %1 :main set drv=unknown %COMSPEC% /c %0 :getdrv > drvtmp.bat call drvtmp.bat echo my drive is: %drv% goto :eof :getdrv prompt set drv=$N echo on %=must be empty=% @echo off :eof
by jeb
11 Feb 2021 05:19
Forum: DOS Batch Forum
Topic: Using VT100 input sequences
Replies: 2
Views: 3349

Re: Using VT100 input sequences

Hi Darvil,

take a look at Attempt to catch arrow keystrokes.
There seems no way to detect the arrow keys with pure batch, but it's possible wit powershell and Aacini built some good helper programs for that.

jeb
by jeb
10 Feb 2021 10:19
Forum: DOS Batch Forum
Topic: Cmd.exe bug with special characters
Replies: 2
Views: 3737

Re: Cmd.exe bug with special characters

Hi,

as JFL already said, the echo %0 is the problem.

If you want to see the content without problems, you could use the REM technique.

Code: Select all

@echo off
echo Test

echo on
REM # %0 #
@echo off

echo Test 2
by jeb
29 Nov 2020 11:32
Forum: DOS Batch Forum
Topic: Is it possible restore overwrited contents like F7-Selection?
Replies: 2
Views: 3283

Re: Is it possible restore overwrited contents like F7-Selection?

But there was a bug Bug in vt101 Alternate Screen Buffer?
- Crashes on company-managed computer with Windows 10.0.16299.1625
- Works fine on another one managed by me, with Windows 10.0.19041.84
by jeb
18 Nov 2020 08:04
Forum: DOS Batch Forum
Topic: About variable expansion
Replies: 8
Views: 6585

Re: About variable expansion

Hi barnabe0057, you used the variable "var" instead of "string". Your replace logic can't work, because if you found two stars at a position you append to the current result a star, else you append the character at the position, so you effectivly ALWAYS append the character at the current position. ...
by jeb
18 Nov 2020 06:31
Forum: DOS Batch Forum
Topic: ANSI Escape Code does not works with (start) command
Replies: 5
Views: 4942

Re: ANSI Escape Code does not works with (start) command

Hi, same failure on my system! Tested on Microsoft Windows [Version 10.0.17763.1397] That's 1809 (What a stupid naming chaos) But I simplified the code a bit @echo off for /F %%A in ('echo prompt $E ^| cmd') do set "ESC=%%A" cls echo %ESC%[2;2H * [2,2] Works ( start "" https://example.com echo %ESC%...
by jeb
18 Nov 2020 06:12
Forum: DOS Batch Forum
Topic: PSU auto shutdown
Replies: 2
Views: 3205

Re: PSU auto shutdown

Hi juleklO, your question is a bit off topic for batch files. Btw. The "GreenCell PowerProof 2000VA" is an UPS not a PSU. Professional PSU's have an IPMI or redfish interface. Many UPS claims to have an interface, but they differ from each vendor and model in many cases it's simply crap, undocumente...
by jeb
02 Nov 2020 04:27
Forum: DOS Batch Forum
Topic: Nesting statement if ()==() ( ) gives an error
Replies: 2
Views: 4245

Re: Nesting statement if ()==() ( ) gives an error

Hi BoQsc, avoid enclosing anything with parenthesis in the IF's, at all. Enclosing should always be done with quotes. IF "c" == "c" ( echo test IF "b" == "b" ( echo yes ) ) Using quotes, avoids problems with spaces in the value (in case of variables) and also special characters cna be used. Parenthe...
by jeb
29 Oct 2020 07:58
Forum: DOS Batch Forum
Topic: A killer : in a comment
Replies: 15
Views: 10684

Re: A killer : in a comment

And this behaviour is a useful feature!

Code: Select all

%LOAD_ONLY_ONCE:call "%~dp0\libBase.cmd" := %
If LOAD_ONLY_ONCE is undefined, the call is executed and there the LOAD_ONLY_ONCE macro is defined.
Any further such line will execute only the macro.

jeb
by jeb
02 Aug 2020 12:01
Forum: DOS Batch Forum
Topic: FOR variable %%A in macro definition gets overridden when script is called by other script within FOR loop
Replies: 15
Views: 11277

Re: FOR variable %%A in macro definition gets overridden when script is called by other script within FOR loop

Thanks Maylow for the question :D I had the same problem some time ago, and it's because I built also a batch macro library :) a) It's expected behaviour b) It can be solved, It can be solved even that you can define macros inside any FOR-Loop and independent of delayed mode It doesn't need setlocal...