Search found 3761 matches

by aGerman
15 Aug 2020 09:02
Forum: DOS Batch Forum
Topic: set command inside for loop does not work
Replies: 1
Views: 19

Re: set command inside for loop does not work

Only variables enclosed in !! are expanded to their new value in a parenthesized block of command lines. And the body of a FOR loop is such a parenthesized block. Also a closing parenthesis in a string might be interpreted as the closing parenthesis of the block. Rather escape it like that in the st...
by aGerman
15 Aug 2020 08:51
Forum: DOS Batch Forum
Topic: [Help] Image in batch file
Replies: 14
Views: 10869

Re: [Help] Image in batch file

Unfortunately this doesn't fix anything. Letting the process live longer also means that the batch processing waits until the process terminates. But this doesn't make sense because you certainly want to immediatelly continue in your script. And guess what happens if the proces finally terminates .....
by aGerman
12 Aug 2020 10:05
Forum: DOS Batch Forum
Topic: Letter used in a variable.
Replies: 9
Views: 167

Re: Letter used in a variable.

Maybe something like that @echo off &setlocal EnableDelayedExpansion set "valid=" for /f "tokens=1,2 delims=[]: " %%i in ('mountvol^|findstr "\<[A-Z]:\\\\"^|find /n /v ""') do set "drive_%%i=%%j" &set "valid=!valid!%%j" choice /c !valid! /n /m "Enter a drive letter [!valid!]: " set "drive=!drive_%er...
by aGerman
11 Aug 2020 10:32
Forum: DOS Batch Forum
Topic: [SOLVED] How to get filename from URL and set it to variable?
Replies: 3
Views: 73

Re: How to get filename from URL and set it to variable?

Why so complicated? Parameter variables support modifiers to extract file name and extension out of the box.

Code: Select all

set "FILENAME=%~nx1"
Refer to the help message of CALL
https://www.dostips.com/DosCommandIndex.php#CALL

Steffen
by aGerman
10 Aug 2020 12:42
Forum: DOS Batch Forum
Topic: Advanced Batch features via auxiliary .exe programs
Replies: 74
Views: 84274

Re: Advanced Batch features via auxiliary .exe programs

Oh. In this case ignore my previous comment. The tool I tested with was from spring 2016 :lol:

Steffen
by aGerman
10 Aug 2020 10:58
Forum: DOS Batch Forum
Topic: Advanced Batch features via auxiliary .exe programs
Replies: 74
Views: 84274

Re: Advanced Batch features via auxiliary .exe programs

If I run your script the log file contains step0: backup current cursor pos? CursorPos.exe current pos: $E=262150 $X=6 $Y=4 :::::::::::::::::::: step1: move new pos 0 0 - simbol "A" CursorPos.exe 0 0 _E=65 _X=65 _Y=0 ==================== step2: move new pos +1 +1 - simbol "B" 3: CursorPos.exe +1 +1 ...
by aGerman
08 Aug 2020 04:08
Forum: DOS Batch Forum
Topic: CONVERTCP.exe - Convert text from one code page to another
Replies: 117
Views: 90519

Re: CONVERTCP.exe - Convert text from one code page to another

The cmd.exe uses UCS-2 internally, so it is not affected by that setting, but that doesn't mean doesn't mean that cleanup isn't neccessary. It is neccessary to restore the old settings (and don't forget to flush the input stream before setting and resetting), because otherwise you may leave other e...
by aGerman
07 Aug 2020 13:40
Forum: DOS Batch Forum
Topic: CONVERTCP.exe - Convert text from one code page to another
Replies: 117
Views: 90519

Re: CONVERTCP.exe - Convert text from one code page to another

It's the stdout file that I switch to 16-bits mode, not the console. This is done using the C library function _setmode(fileno(stdout), _O_WTEXT). I suppose that the cleanup is done automatically when the program exits, because I don't do any cleanup myself. Yes, that's what I was talking about. An...
by aGerman
05 Aug 2020 10:31
Forum: DOS Batch Forum
Topic: Old topic about xcopy
Replies: 8
Views: 416

Re: Old topic about xcopy

/MIR Are you aware that this is for mirroring? the above works but still complaining and gave me red failed warn without any detailed info in bamboo plan... :( Robocopy has several levels of "failing" where some of them don't even mean there was an error. So, you should have quoted the summary in t...
by aGerman
03 Aug 2020 14:11
Forum: DOS Batch Forum
Topic: auto updater of new releases
Replies: 6
Views: 1597

Re: auto updater of new releases

Is it posisble to modify to check if the file localy exists, and if not ... Something like if not exist "c:\foo\bar.exe" ... then jsut download the file from the remote directory? The second FOR loop defines variable recent_file that you should use to copy the file then. + also, would be possible t...
by aGerman
03 Aug 2020 10:59
Forum: DOS Batch Forum
Topic: CONVERTCP.exe - Convert text from one code page to another
Replies: 117
Views: 90519

Re: CONVERTCP.exe - Convert text from one code page to another

Hi Jean-François, It wouldn't have helped c160704 to define defaults since they didn't know the encoding of the incoming file :lol: However, I also thought a lot about defaults. Thank's for your suggestions :!: Definitely worth to consider again. FWIW It's not that CONVERCP doesn't support defaults....
by aGerman
25 Jul 2020 11:35
Forum: DOS Batch Forum
Topic: Old topic about xcopy
Replies: 8
Views: 416

Re: Old topic about xcopy

As far as I recall xcopy doesn't support UNC paths. So, either map it to a drive using NET USE or just change the current directory using PUSHD/POPD.
To avoid this pain use ROBOCOPY rather than XCOPY.

Steffen
by aGerman
25 Jul 2020 11:26
Forum: DOS Batch Forum
Topic: JREPL: Cutting of a string after the n-th occurrence of specific character?
Replies: 17
Views: 688

Re: JREPL: Cutting of a string after the n-th occurrence of specific character?

Well, the site I referenced has a pretty good explanation of the pattern in the right pane. What about removing the $ from the pattern? Also, for simpler stuff like extracting the contents of brackets, what is faster: JREPL or findstr? findstr might be faster but it has only poor regex support and i...
by aGerman
22 Jul 2020 07:54
Forum: DOS Batch Forum
Topic: JREPL: Cutting of a string after the n-th occurrence of specific character?
Replies: 17
Views: 688

Re: JREPL: Cutting of a string after the n-th occurrence of specific character?

I think the pattern should work out of the box along with JREPL. Did you try out already?

Steffen