Search found 1043 matches
- 23 Jun 2021 12:08
- Forum: DOS Batch Forum
- Topic: Some undocumented things with turned off command extensions
- Replies: 14
- Views: 13746
Re: Some undocumented things with turned off command extensions
Hi CJM, I cannot get GOTO :EOF (nor GOTO:EOF, with or without space, in all-caps) to function with DisableExtensions unless an :EOF (or :eof) label is present. It's the expected behavior. With Disabled Extensions there is no implicit :EOF label anymore. I'm not sure what Sponge Belly said with, if h...
- 31 May 2021 04:14
- Forum: DOS Batch Forum
- Topic: Unexpected DOS shell expansion of %~n1 and %~x1
- Replies: 4
- Views: 4641
Re: Unexpected DOS shell expansion of %~n1 and %~x1
Hi,
for me it was unexpected, that wildcards are expanded, if the content is in %1..%9 or even in a FOR meta variable.
for me it was unexpected, that wildcards are expanded, if the content is in %1..%9 or even in a FOR meta variable.
Code: Select all
@echo off
echo %%1=%1 - no wildcard expansion
echo %%~1=%~1 - no wildcard expansion
echo %%~n1=%~n1 - wildcard expansion
echo %%~f1=%~f1 - wildcard expansion
- 19 May 2021 00:31
- Forum: DOS Batch Forum
- Topic: Batch coloring not working after git output
- Replies: 2
- Views: 3061
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
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
- 12 Apr 2021 09:17
- Forum: DOS Batch Forum
- Topic: MS-DOS 6.22 variable trimming
- Replies: 3
- Views: 4235
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"==...
- 02 Apr 2021 06:23
- Forum: DOS Batch Forum
- Topic: MS-DOS 6.22 variable trimming
- Replies: 3
- Views: 4235
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...
- 19 Feb 2021 01:46
- Forum: DOS Batch Forum
- Topic: Apostrophe at beginning of file name
- Replies: 6
- Views: 6215
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...
- 17 Feb 2021 03:30
- Forum: DOS Batch Forum
- Topic: Problem with variable Drive setup for XP/W98SE
- Replies: 18
- Views: 20192
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 ...
- 16 Feb 2021 06:00
- Forum: DOS Batch Forum
- Topic: Problem with variable Drive setup for XP/W98SE
- Replies: 18
- Views: 20192
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
- 11 Feb 2021 05:19
- Forum: DOS Batch Forum
- Topic: Using VT100 input sequences
- Replies: 2
- Views: 3425
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
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
- 10 Feb 2021 10:19
- Forum: DOS Batch Forum
- Topic: Cmd.exe bug with special characters
- Replies: 2
- Views: 3823
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.
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
- 29 Nov 2020 11:32
- Forum: DOS Batch Forum
- Topic: Is it possible restore overwrited contents like F7-Selection?
- Replies: 2
- Views: 3360
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
- 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
- 18 Nov 2020 08:04
- Forum: DOS Batch Forum
- Topic: About variable expansion
- Replies: 8
- Views: 6757
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. ...
- 18 Nov 2020 06:31
- Forum: DOS Batch Forum
- Topic: ANSI Escape Code does not works with (start) command
- Replies: 5
- Views: 5068
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%...
- 18 Nov 2020 06:12
- Forum: DOS Batch Forum
- Topic: PSU auto shutdown
- Replies: 2
- Views: 3306
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...
- 02 Nov 2020 04:27
- Forum: DOS Batch Forum
- Topic: Nesting statement if ()==() ( ) gives an error
- Replies: 2
- Views: 4480
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...