Search found 177 matches

by amel27
04 May 2011 03:03
Forum: DOS Batch Forum
Topic: Access complex parameters
Replies: 15
Views: 16403

Re: Access complex parameters

Hi, All! Nice thread 2) breaks the CALL of the parent running nested BAT without CALL terminate current BAT thread @echo off SetLocal EnableDelayedExpansion set var1=TEST myBatch !var1! echo This line not typed If your have several nested calls, each BAT running without CALL terminate last thread. I...
by amel27
27 Jan 2011 00:44
Forum: DOS Batch Forum
Topic: Echoing /?
Replies: 6
Views: 5992

Re: Echoing /?

Code: Select all

echo./?
by amel27
23 Jan 2011 04:29
Forum: DOS Batch Forum
Topic: Adjustable PING delay. Is 128.0.0.1 always good ?
Replies: 12
Views: 13187

Re: Adjustable PING delay. Is 128.0.0.1 always good ?

I thought XP had a cache in RAM that should remember what was loaded the first time, and then repeat without clattering through the disk every time ! ! ! Yes, XP have cache, but Windows dinamically operates its content. AFAIK impossible manually control individual file caching. Caching whole BAT fi...
by amel27
22 Jan 2011 09:26
Forum: DOS Batch Forum
Topic: Adjustable PING delay. Is 128.0.0.1 always good ?
Replies: 12
Views: 13187

Re: Adjustable PING delay. Is 128.0.0.1 always good ?

Hi All. 128.0.0.0/24 is Netherlands address pool. According to RFC 3330 we can use for this purposes two pools: 192.0.2.0/24 - This block is assigned as "TEST-NET" for use in documentation and example code. It is often used in conjunction with domain names example.com or example.net in ven...
by amel27
22 Jan 2011 02:11
Forum: DOS Batch Forum
Topic: mailto
Replies: 5
Views: 9015

Re: mailto

try this sample batch SMTPSend function (JS inside): @set @x=0 /* @echo off ::--- start proper batch --- set SMTPsubj=Test Mail set SMTPtext=Mail Text call:SMTPSend "%~f0" smtp.srv.com userFrom@my.com userTo@my.com SMTPsubj SMTPtext EXIT :SMTPSend BatchName, SMTP_Server, MailFrom, MailTo, ...
by amel27
20 Jan 2011 20:47
Forum: DOS Batch Forum
Topic: [SOLVED]I need a function that deletes a single line in a...
Replies: 13
Views: 12339

Re: [SOLVED]I need a function that deletes a single line in

aGerman wrote:This is my proposal
Nice tip, aGerman, thanks. But your SUB required DisableDelayedExpansion too. If main script use EnableDelayedExpansion mode, exclamations cut out from text.
by amel27
20 Jan 2011 07:28
Forum: DOS Batch Forum
Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
Replies: 44
Views: 212159

Re: ECHO. FAILS to give text or blank line - Instead use ECH

jeb wrote:No it starts only once, the second delay is in the echo %%a itself.
Yes, I understand... Thanks again!
Unfortunately, I gave out wished for the valid. It turns out that substitution doesn't work for new CMD call... :(
by amel27
20 Jan 2011 04:54
Forum: DOS Batch Forum
Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
Replies: 44
Views: 212159

Re: ECHO. FAILS to give text or blank line - Instead use ECH

It shows that the command-token and the rest of the line are handled separately. Great! Most likely, that delayed expansion work after tokens merged to "supertokens" like command or text stream (list of parameters), and each "supertoken" expand separately… Not the "echo(&qu...
by amel27
19 Jan 2011 03:38
Forum: DOS Batch Forum
Topic: Simple SMTP Batch Script
Replies: 4
Views: 9928

Re: Simple SMTP Batch Script

deibertine, You can use Plink, a command-line tool which comes with PuTTY, to automate Telnet sessions
by amel27
19 Jan 2011 03:09
Forum: DOS Batch Forum
Topic: Question about FINDSTR
Replies: 3
Views: 4695

Re: Question about FINDSTR

darioit wrote:to search some in the 2 field?
by regular expression feature:

Code: Select all

FindStr /BRC:"[^;]*;%%a;" file.txt
by amel27
19 Jan 2011 03:03
Forum: DOS Batch Forum
Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
Replies: 44
Views: 212159

Re: ECHO. FAILS to give text or blank line - Instead use ECH

Thanks jeb, it is helpful ...but "ECHO(" not compatibly with parentheses ( echo(!str:0=)! ) ...and some more constraints added: @echo off SETLOCAL EnableDelayedExpansion set str=FFFF00000 echo. echo str:%str% echo sub:^^!str:0=F^^! echo. echo sometimes tokens delims not restored for /f &qu...
by amel27
19 Jan 2011 02:21
Forum: DOS Batch Forum
Topic: Question about FINDSTR
Replies: 3
Views: 4695

Re: Question about FINDSTR

darioit wrote:Why the 2 row and not the First?

Because "AAA" contains in each line, but remain last var assignment,
try this FindStr call for search from begin to ";" char:

Code: Select all

FINDSTR /B "%%a;" file.txt
by amel27
18 Jan 2011 23:17
Forum: DOS Batch Forum
Topic: [SOLVED]I need a function that deletes a single line in a...
Replies: 13
Views: 12339

Re: I need a function that deletes a single line in a text f

ghostmachine4 wrote:I wouldn't want to use it if my lines ever were to unknowingly contain a beginning "[".
leading "[" supported, only leading "]" stripped from line
by amel27
18 Jan 2011 08:38
Forum: DOS Batch Forum
Topic: [SOLVED]I need a function that deletes a single line in a...
Replies: 13
Views: 12339

Re: [SOLVED]I need a function that deletes a single line in

akol, sorry, "DisableDelayedExpansion" added,
otherwise exclamations cut out from text
by amel27
18 Jan 2011 08:01
Forum: DOS Batch Forum
Topic: [SOLVED]I need a function that deletes a single line in a...
Replies: 13
Views: 12339

Re: I need a function that deletes a single line in a text f

via native CMD, text lines must not begin with "]" @echo off call:DelLine file.txt 10 exit :DelLine %file% %line_no% SETLOCAL DisableDelayedExpansion set "$TMP=%TEMP%\%RANDOM%%RANDOM%.tmp" (for /f "tokens=1* delims=]" %%a in ('^<%~1 find /v /n ""') do ( if not...