Search found 1042 matches

by jeb
28 Jun 2010 07:44
Forum: DOS Batch Forum
Topic: How to replace special characters...
Replies: 4
Views: 11676

Re: How to replace special characters...

Hi, this should work, you got the complete content. @echo off setlocal ENABLEDELAYEDEXPANSION for /f "tokens=1* delims=" %%a in (tmp.tmp) do ( set par1=%%a echo !par1! ) If you want to escape the characters too, you could use something like @echo off setlocal ENABLEDELAYEDEXPANSION for /f ...
by jeb
10 Jun 2010 11:08
Forum: DOS Batch Forum
Topic: variable in cycle
Replies: 3
Views: 4174

Re: variable in cycle

You got me. :)

You can see, I haven't tested it.

jeb
by jeb
10 Jun 2010 11:04
Forum: DOS Batch Forum
Topic: string concatenation in a for loop
Replies: 6
Views: 14684

Re: string concatenation in a for loop

Hi, the problem is the line set zz=echo %xx% & echo %yy% The & doesn't concatenate it will split the line into two commands so it is equal to set zz=echo %xx% echo %yy% But the next problem is that in %zz% is now "echo ASCII", I suppose you only want the "ASCII" command. ...
by jeb
09 Jun 2010 08:48
Forum: DOS Batch Forum
Topic: script was working, now it will not
Replies: 1
Views: 2622

Re: script was working, now it will not

Hi df9870, The reason is the expansion phase of the variable. The %var% is only expanded once, at the beginning of the block (). So you only see the value before you entered the block. If you want to use the current value use the delayed expansion syntax. @echo off setlocal EnableDelayedExpansion fo...
by jeb
09 Jun 2010 08:43
Forum: DOS Batch Forum
Topic: variable in cycle
Replies: 3
Views: 4174

Re: variable in cycle

Hi, zzz is not empty, but the way you try to print it fails. The reason is the expansion phase of the %zzz%. The %zzz% is only once expanded, at the beginning of the block (). So you only see the value before you entered the block. If you want to use the current value use the delayed expansion synta...
by jeb
02 Jun 2010 11:57
Forum: DOS Batch Forum
Topic: Whats 2>%1
Replies: 5
Views: 5410

Re: Whats 2>%1

Hi,

aGerman wrote:I could give you some good links to german tutorials, but I think it would be senseless for you :|


but not for me (and some others here) because I'm a German too, but not aGerman :)
by jeb
27 May 2010 14:45
Forum: DOS Batch Forum
Topic: Redirect Twice
Replies: 5
Views: 6944

Re: Redirect Twice

I suppose, I am such a "poor man" who try to solve it with pure dos batch. Because, if I want to solve it easy or short or ..., I shouldn't take dos batch, there are very good alternatives like python, php, perl or c (sorry gostmachine, vbs is not such an alternative) For me it's fun to fi...
by jeb
22 May 2010 10:23
Forum: DOS Batch Forum
Topic: More On User Input
Replies: 4
Views: 5042

Re: More On User Input

So I can't put anything in between the two input questions? No,what !k said is, that it these two lines are different set /p itemNumber=Please type the item number here: set /p itemNumber =Please type the item number here: If you place a space between the itemNumber and the equal sign the name of t...
by jeb
20 May 2010 12:07
Forum: DOS Batch Forum
Topic: set /p timeout
Replies: 3
Views: 6143

Re: set /p timeout

The only way with pure batch seems to be the use of two cmd-windows.

You can start a second cmd window and start the set /p input in the second window, so the first one can build it's own "timeout".

jeb
by jeb
20 May 2010 12:04
Forum: DOS Batch Forum
Topic: Find files 15 min old in a dir and send mail
Replies: 4
Views: 5320

Re: Find files 15 min old in a dir and send mail

Hi,

I suppose the sendmail fails, but better you post the output here.

jeb
by jeb
13 May 2010 23:15
Forum: DOS Batch Forum
Topic: Batch ffmpeg auto convert
Replies: 14
Views: 17447

Re: Batch ffmpeg auto convert

hi central10, the problem, that always the "previous" file will be taken, is a batch specific behaviour at if "%currentlatestFile%" NEQ "%latestFile%" ( echo new file "%currentlatestFile%" set "latestFile=%currentlatestFile%" call :openFile %latestFi...
by jeb
13 May 2010 10:56
Forum: DOS Batch Forum
Topic: Find files 15 min old in a dir and send mail
Replies: 4
Views: 5320

Re: Find files 15 min old in a dir and send mail

Hi redro, first you have to solve the "mail to" problem your own code @echo off & setlocal :: set the temp file location set tempmail=%temp%\tempmail.%random%.txt :: echo the basic headers to the temp file echo To: "Scripting Test" ^<praveen.pullela@sirvisetti.com^>, ^<prakas...
by jeb
13 May 2010 09:56
Forum: DOS Batch Forum
Topic: If condition issue
Replies: 7
Views: 8136

Re: If condition issue

and the next round begin set var=%% and set var = %%a are different things, (first the name of the variable is "var" in the second case it is "var " (with one space). so your code should look like @echo off setlocal set var=empty FOR /f "tokens=4*" %%a in (pcheck.txt) d...
by jeb
13 May 2010 08:42
Forum: DOS Batch Forum
Topic: If condition issue
Replies: 7
Views: 8136

Re: If condition issue

hi redo, try to use some debugging code, to see what you read. setlocal set var=empty FOR /f "tokens=4*" %%a in (pcheck.txt) do ( set var = %%a echo read "%%a" ) echo Comparing "%var%" with "LISTENING" IF "%var%"=="LISTENING" ( echo Ecm is ...
by jeb
13 May 2010 08:00
Forum: DOS Batch Forum
Topic: If condition issue
Replies: 7
Views: 8136

Re: If condition issue

hi redro, FOR /f "tokens=4*" %%a in (pcheck.txt) do ( set var = %%a) IF %var% == "LISTENING" echo Ecm is still running else echo "Sending alarm" This can't work, because a block has to begin at the same line (look at if /?) The second problem is your compare %var%==&quo...