Search found 177 matches

by amel27
18 Jan 2011 07:42
Forum: DOS Batch Forum
Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
Replies: 44
Views: 214469

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

Hi All! some more constraint of "ECHO." with explanation in DelayedExpansion mode: echo !str:~-2! echo.!str:~-2! echo:!str:~-2! echo. echo !str:0=9! echo.!str:0=9! echo:!str:0=9! echo. echo !str:~0,-2! echo.!str:~0,-2! echo:!str:~0,-2! result: 90 90 90 1234567899 str:0=9 str:0=9 12345678 s...
by amel27
18 Jan 2011 03:15
Forum: DOS Batch Forum
Topic: Insert keystroke into executed batch command
Replies: 9
Views: 15401

Re: Insert keystroke into executed batch command

avery_larry wrote:echo.y|xxcopy
It would be too simple, but unfortunately XXCOPY not work with StdInput... :(
by amel27
16 Jan 2011 06:10
Forum: DOS Batch Forum
Topic: Write symbol ">"
Replies: 5
Views: 6680

Re: Write symbol ">"

Escape special characters,
read this: http://www.dostips.com/?t=Snippets.Escape
by amel27
16 Jan 2011 04:14
Forum: DOS Batch Forum
Topic: Write symbol ">"
Replies: 5
Views: 6680

Re: Write symbol ">"

by "^" symbol before ">"

Code: Select all

echo tree ^>nul>>test.bat
by amel27
14 Jan 2011 04:01
Forum: DOS Batch Forum
Topic: Insert keystroke into executed batch command
Replies: 9
Views: 15401

Re: Insert keystroke into executed batch command

try this complicated batch file (with JS inside) - not tested, because I can't reproduce your problem in my environment - replace "xxcopy /?" to your xxcopy calls (lead ECHO command required!) - replace "Press any key" to any other key text if need - your own BAT code must be bet...
by amel27
25 Nov 2010 00:05
Forum: DOS Batch Forum
Topic: How Use special | > < = & in variable Dos
Replies: 7
Views: 8481

Re: How Use special | > < = & in variable Dos

another problem - replacing substring with "=" char w/o char by char reading,
for example, remove substring ",var2=2" in string "var1=1,var2=2,var3=3"
by amel27
24 Nov 2010 05:28
Forum: DOS Batch Forum
Topic: How Use special | > < = & in variable Dos
Replies: 7
Views: 8481

Re: How Use special | > < = & in variable Dos

Code: Select all

@echo off
for /f "delims=" %%a in (file_inp.txt) do (
  >>file_out.txt echo %%a
)
by amel27
23 Nov 2010 19:38
Forum: DOS Batch Forum
Topic: ignore files
Replies: 1
Views: 3729

Re: ignore files

In the for %%D in .. line, how to skip "*myfile*.txt files that has the word "EPQ" in them?. for %%D in (*myfile*.txt) do ( findstr "EPQ" "%%D">nul|| for /f "tokens=1 delims=+" %%H in ("%%~nD") do ( echo %%H ) ) - "goto do" command in...
by amel27
23 Nov 2010 18:53
Forum: DOS Batch Forum
Topic: how to pass/read unicode char on command line/batch script
Replies: 12
Views: 31780

Re: how to pass/read unicode char on command line/batch scri

That just converts certain OEM to UTF-8... hmm... interesting, for me it convert OEM to UTF16, but without BOM ( Byte order mark ), BOM can be write to file before text output If you want to see what I mean, try experimenting with this Japanese character I think, before experimenting destination lo...
by amel27
23 Nov 2010 06:39
Forum: DOS Batch Forum
Topic: how to pass/read unicode char on command line/batch script
Replies: 12
Views: 31780

Re: how to pass/read unicode char on command line/batch scri

orange_batch wrote:
amel27 wrote:TYPE command may use for read UTF16/UTF8 files with BOM for convert to OEM/ANSI


Example please?

of course mistake for UTF8, but work for UTF16 with BOM: :roll:

Code: Select all

(for /f "delims=" %%a in  ('type utf16.txt') do echo.%%a
)>oem.txt
by amel27
23 Nov 2010 03:29
Forum: DOS Batch Forum
Topic: how to pass/read unicode char on command line/batch script
Replies: 12
Views: 31780

Re: how to pass/read unicode char on command line/batch scri

I did extensive research into unicode in relation to Command Prompt for my own purposes recently. It can receive unicode arguments from explorer.exe/Windows OS. It can write unicode to a text file in UTF-16LE format. Use "cmd /u" and redirect ">" / ">>". But... It can'...
by amel27
16 Nov 2010 18:02
Forum: DOS Batch Forum
Topic: basic dir option
Replies: 3
Views: 4848

Re: basic dir option

Code: Select all

dir /b/s|sort
by amel27
16 Nov 2010 03:21
Forum: DOS Batch Forum
Topic: strLen boosted
Replies: 24
Views: 35718

Re: strLen boosted

Excellent!.. From this follows quick code for string up to 255 chars: set "str=%1" call :strLength result str echo %str% length is %result% goto :eof :strLength setlocal EnableDelayedExpansion REM broken into multiple lines by forum moderator to address forum readability issue. FOR BETTER ...
by amel27
16 Nov 2010 02:49
Forum: DOS Batch Forum
Topic: compare multiple strings in same line
Replies: 2
Views: 4328

Re: compare multiple strings in same line

akshunj wrote:how I could compare multiple strings in the same command.

Code: Select all

set "OR_Cmd=set var=X"
if not string1==string2 (if not string1==string3 (if string1==string4 %OR_Cmd%) else %OR_Cmd%) else %OR_Cmd%
by amel27
16 Nov 2010 02:30
Forum: DOS Batch Forum
Topic: Unable to call multiple bat files from single bat file
Replies: 2
Views: 4327

Re: Unable to call multiple bat files from single bat file

if you start separate BAT job you can use:

Code: Select all

start "Job 1" CMD /C "Job_1.bat"

if you start BAT within current job you must use CALL

Code: Select all

CALL "Include_1.bat"