Search found 917 matches

by jeb
28 Aug 2018 01:57
Forum: DOS Batch Forum
Topic: help to create a batch-file
Replies: 2
Views: 694

Re: help to create a batch-file

Hi Pf@nne, you could store the directory names in an array (not really an array, but it has the look and feel). @echo off cls REM ----------------------------------------- REM Verzeichnis auslesen und anzeigen REM ----------------------------------------- setlocal EnableDelayedExpansion cd _customDe...
by jeb
01 Aug 2018 06:12
Forum: DOS Batch Forum
Topic: Reading a hidden password via a FINDSTR bug
Replies: 10
Views: 2627

Re: Reading a hidden password via a FINDSTR bug

Works fine on my Win7 x64 Professional. I'm astonished at the findstr redirection to CON. I didn't expected any color effects for redirected text to CON at all, I expected to see control codes like for CLS > CON I saw this effect before, when I build the findstr color technic, but I always assumed t...
by jeb
25 Jun 2018 07:13
Forum: DOS Batch Forum
Topic: Change the influence of one batch file when other one is running
Replies: 3
Views: 1241

Re: Change the influence of one batch file when other one is running

two.bat

Code: Select all

@echo off
call :secretLabel
exit /b

:secretLabel
one.bat
Obviously 8) , this will start :secretLabel in one.bat

You don't need to start one.bat before
by jeb
18 Jun 2018 11:32
Forum: DOS Batch Forum
Topic: Line read in a loop from a file doesn't assign properly in batch program
Replies: 2
Views: 732

Re: Line read in a loop from a file doesn't assign properly in batch program

Hi jrahman, I closed your question on StackOverlflow as it is a duplicate of Variables in batch not behaving as expected . There is explained why your echo %testCaseName% fails. Percent expansion is evaluated when a block is parsed, before it will be executed. So in your sampe %testCaseName% is expa...
by jeb
13 Jun 2018 00:43
Forum: DOS Batch Forum
Topic: Dateien verbinden und / Fehler bei Inhalte suchen
Replies: 2
Views: 855

Re: Dateien verbinden und / Fehler bei Inhalte suchen

Hi FireBuff, the language for this forum is english, it would be polite to translate your question. Like Newbee wrote, I suppose the problem is not in your code. Instead it's probably that findstr simply finds two lines with "VV011". You could test this, add /N to findstr ("findstr /N ...") this wil...
by jeb
28 May 2018 23:00
Forum: DOS Batch Forum
Topic: How to mask a blank inside nested quotes?
Replies: 11
Views: 2394

Re: How to mask a blank inside nested quotes?

Hi pstein,

as sst said, it's a problem how FOR/F invokes cmd.exe.
It can be solved with the additional quotes like the sample of sst.

Or you prefix your command with CALL

Code: Select all

for /F usebackq %%L in (`CALL "%PROG%myprog.exe" ...... %%F`) do set %%L
by jeb
25 May 2018 02:32
Forum: DOS Batch Forum
Topic: Get arguments without temporary file
Replies: 24
Views: 4085

Re: Get arguments without temporary file

@JanAntonin I'm missing the part where the arguments are transfered to a variable. @Ed Dyreen I optimized the code a bit for macronisation, remove labels, findstr. That looks quite good, BUT to remove the findstr after 'doskey /macros' isn't a good idea, as it sets any amount of variables, for each ...
by jeb
22 May 2018 23:46
Forum: DOS Batch Forum
Topic: Get arguments without temporary file
Replies: 24
Views: 4085

Re: Get arguments without temporary file

It doesn't seem to like spaces in current directory. :( Stupid jeb code, we always needs to fix stupid jeb code :evil: Yes, and I'm the first one who criticize such sloppy code :( But beside that bugs I tested with line feeds and it suprises me, as line feeds are converted to ampersands. @ech off s...
by jeb
22 May 2018 15:04
Forum: DOS Batch Forum
Topic: Get arguments without temporary file
Replies: 24
Views: 4085

Re: Get arguments without temporary file

I think you are on the right way. But I can't understand why you parse the options before launching the test script? Why you don't use it simply calling like GetParam.bat %*? The problem for the unittest is the fact, that I don't know a simple way to show the argument that will be used and use that...
by jeb
22 May 2018 12:48
Forum: DOS Batch Forum
Topic: Get arguments without temporary file
Replies: 24
Views: 4085

Re: Get arguments without temporary file

I build a small unittest with different more or less complex arguments. @echo off setlocal DisableDelayedExpansion set "destBatch=GetParam.bat" set "arg1=simple text" set "arg2=special unquoted &|<>%%!^#" set ^"arg3=special quoted "&|<>%%!^#"" set "arg4=&"^&" set "arg5=caret^"caret2^^.." set "arg6=^...
by jeb
22 May 2018 11:51
Forum: DOS Batch Forum
Topic: Get arguments without temporary file
Replies: 24
Views: 4085

Re: Get arguments without temporary file

Hi penpen, really stupid bug. I simply forgot the exclamation marks. It can be fixed by moveing the setlocal EnabledelayedExpansion behind the "pipe-block". @echo off for /F "tokens=3 delims=:" %%F in ("%~0") do goto %%F :getParam setlocal DisableDelayedExpansion (set LF=^ %=empty=% ) > nul break | ...
by jeb
22 May 2018 07:17
Forum: DOS Batch Forum
Topic: Get arguments without temporary file
Replies: 24
Views: 4085

Get arguments without temporary file

Hi, after the claim of Jan Antonin, I take a closer look at the problem and I found a nearly simple method My biggest (not from the pragmatic point of view of course) contribution which I am really proud of will be an ultimate method of obtainig all command line arguments of a sript inside from the ...
by jeb
22 May 2018 03:16
Forum: DOS Batch Forum
Topic: Length of a string - my first contribution
Replies: 4
Views: 986

Re: Length of a string - my first contribution

Hi Jan, like sst I'm interessted in this part. My biggest (not from the pragmatic point of view of course) contribution which I am really proud of will be an ultimate method of obtainig all command line arguments of a sript inside from the script of course. With no compromise, without any temp file....
by jeb
18 May 2018 02:24
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 42
Views: 10934

Re: Discussion about jeb's batch parsing rules on StackOverflow

Related to a comment from aschipf at stackoverflow: Phase 7.1: I think it would be worth mentioning that for the special set semantics set "name=content" ignored the command extensions need to be enabled, otherwise a syntax error arises: what do you think, @dbenham or @jeb? In my opinion, the SET-sy...
by jeb
19 Apr 2018 13:15
Forum: DOS Batch Forum
Topic: Strange for loop behaviour
Replies: 3
Views: 1258

Re: Strange for loop behaviour

Hi penpen, I'm a bit puzzeled about what result you expect. :?: I'm not really surprised, that you always get i=1 I simplyfy your code a bit, trying to build a minimal example. I first removed the timestamp stuff and the variable x and also the %% 4 set "loadColors=(set "i=0" & (for %%a in (!table!)...