Search found 239 matches

by pieh-ejdsch
11 Jul 2014 11:40
Forum: DOS Batch Forum
Topic: Batch function help?
Replies: 45
Views: 23950

Re: Batch function help?

this Routine I have optimized. 1. Same Letters Upper- and Lowercase can Set into one Var (named Letter). once a time to intitiate this Alphabet. 2. only one Forloop to read the string one by one. 3. with the correct "delims" (all other Singn) we reduce the nonAlphabetic Output and Error Me...
by pieh-ejdsch
06 Jul 2014 14:44
Forum: DOS Batch Forum
Topic: Batch function help?
Replies: 45
Views: 23950

Re: Batch function help?

Finally you can reduce the changin loops (7 doubled processes) into:
one call and two for loops with positive results.

See on this:
http://www.administrator.de/forum/batch-input-so-abgreifen-als-w%c3%a4re-die-tastatur-auf-en-us-gestellt-233504.html#comment-913924

Phil
by pieh-ejdsch
06 Jul 2014 04:52
Forum: DOS Batch Forum
Topic: Batch function help?
Replies: 45
Views: 23950

Re: Batch function help?

To reduce the if's you can use every Loop once a time. A negative for loop is Much efficent as two if's. Minus 30% for /l %%g in (0,1,%#%) do ( call set j=%%@:~%%g,1%% (for /f "delims=AaEeIiLlNnOoRrSsTtUu" %%h in ("!j!") do @ )||set /a $+=1 (for /f "delims=DdGg" %%h in ...
by pieh-ejdsch
17 May 2014 14:26
Forum: DOS Batch Forum
Topic: converting short path name to long path name
Replies: 4
Views: 6920

Re: converting short path name to long path name

Hallo,

with Dir and ".?" at the end it prompt the full Name

Code: Select all

Dir /s/b/x C:\instance\domains\DAC04Q~1.COM\COMMON~1.?


Phil
by pieh-ejdsch
06 May 2014 06:45
Forum: DOS Batch Forum
Topic: print output to txt file
Replies: 2
Views: 2805

Re: print output to txt file

Hi, i have modified Daves Tee.cmd a time ago. It is not fast but interaktive commands in the log you can read in the cmd-line (command prompt) empty Lines in promt only displayed as one empty line. --- No Support for [strg]+[C]. ::batchTee.bat usage: :: command >logfile |batchTee LogFile @echo off s...
by pieh-ejdsch
17 Apr 2014 11:42
Forum: DOS Batch Forum
Topic: short way to input with xcopy
Replies: 12
Views: 13482

Re: short way to input with xcopy

In your code, for execution is not terminated if not j; n or y n, etc. depending on the language setting is pressed. At a keystroke, the researchers bight could be completed in a subroutine through an exit / b. However, if the option is only an indefinite keystroke to read something, then I use this...
by pieh-ejdsch
15 Apr 2014 15:10
Forum: DOS Batch Forum
Topic: short way to input with xcopy
Replies: 12
Views: 13482

Re: short way to input with xcopy

@aGerman thank you for that explanation. I can't do that - my bad english So I have competed the code, that the last Token before Input is Autoset. At other language settings for example. @echo off setlocal disabledelayedexpansion :init_token_Keypress for /f "eol=1delims=#" %%d in ('"...
by pieh-ejdsch
14 Apr 2014 13:26
Forum: DOS Batch Forum
Topic: short way to input with xcopy
Replies: 12
Views: 13482

short way to input with xcopy

Hallo, I've seen this in most batches: for /f "delims=" %%A in ('xcopy /w "%~f0" "%~f0" 2^>nul') do ( if not defined key set "key=%%A" ) set "key=!key:~-1!" There is a simpe way to read the first line: The output with file is not promt when use /Q In...
by pieh-ejdsch
23 Mar 2014 10:41
Forum: DOS Batch Forum
Topic: Testing on input
Replies: 13
Views: 8671

Re: Testing on input

another Version @echo off for /f "eol=0 tokens=2,3 delims=(/)" %%a in ('"echo n|xcopy /L/-y %windir%\win.ini %windir%\system.ini"') do ( <nul set/p=Choice %%a %%b ? xcopy /Lpy "%~f0" "%~dp0.xc)*"|findstr /b [1-9] >nul &&echo %%a ||echo %%b ) pause exit...
by pieh-ejdsch
20 Mar 2014 22:25
Forum: DOS Batch Forum
Topic: Testing on input
Replies: 13
Views: 8671

Re: Testing on input

good morning, with using only Set /p you put them into a for /f Loop: you Do not need to check if n/no into for-Loop: then into for-Loop at last "Else goto :false" @echo off :Input for /f delims^= %%i in ('^>con set /p "X=Shuld it be ? give me [Y], [Yes] or [N], [No]: " ^&^&a...
by pieh-ejdsch
12 Mar 2014 05:46
Forum: DOS Batch Forum
Topic: [SOLVED] Batch to Parse tags from .log file
Replies: 12
Views: 17168

Re: [SOLVED] Batch to Parse tags from .log file

To extract text from HTML or XML you can use this simple pure Batchscript http://www.administrator.de/forum/html-dateien-nach-bestimmten-strings-auslesen-und-in-textdatei-speichern-180748.html#comment-733852 @echo off&setlocal pushD "%~dp0" if "%~1" equ "" rd & ...
by pieh-ejdsch
09 Mar 2014 14:18
Forum: DOS Batch Forum
Topic: search file using bat (no user input)
Replies: 7
Views: 5587

Re: search file using bat (no user input)

Within a for /f command you use

Code: Select all

dir /a-d /o-d *.txt

to Set the newest file into Var.
Then you can rename Var.

Phil
by pieh-ejdsch
07 Mar 2014 03:36
Forum: DOS Batch Forum
Topic: some questions
Replies: 14
Views: 8470

Re: some questions

if you in a call - with Parameter %0 you can check this

Code: Select all

:Sub
 rem if not in Sub than not Exit
if "%~0" equ ":Sub" Exit /b


Phil
by pieh-ejdsch
06 Mar 2014 05:11
Forum: DOS Batch Forum
Topic: Asynchronous native batch tee script
Replies: 27
Views: 34357

Re: Asynchronous native batch tee script

Good mornig, you can read Input without using find. Now you can read any comments for Input one key. command with Output Redirect into Logfile. Then the simultan Batch only runs to read this logfile. No Line number only one empty line a time. ::batchTee.bat usage: :: command >logfile |batchTee LogFi...