Search found 34 matches

by allal
11 Aug 2011 11:30
Forum: DOS Batch Forum
Topic: Manipulating directory string
Replies: 7
Views: 6707

Re: Manipulating directory string

please stop complicating things especialy Ed Dyreen who forever try to make things complex and worse instead of solving the issue
i call Ed Dyreen codes a MAGICAL TALISMAN


what about this

Code: Select all

for %%G in ("%DestPath%") do set "parentdir=%%~dpG"


nothing is simple than that
by allal
25 Jul 2011 06:25
Forum: DOS Batch Forum
Topic: [Solved] find or findstr prompt issue
Replies: 11
Views: 11856

Re: find or findstr prompt issue

bouchta if you are like jeb or dbenham who tries always to find solution native cmdly,then be prepared for a long journey where you will start travelling to world forums till you have a looooooooooong white beard and walking on wooden stick,nice rides fill all over your face following the misleader ...
by allal
17 Jul 2011 12:54
Forum: DOS Batch Forum
Topic: [Solved] preventing the call return
Replies: 10
Views: 8224

Re: [Solved] preventing the call return

ok you really saved me benham thanks a lot

so i will stick with the fatal syntax error
by allal
17 Jul 2011 09:21
Forum: DOS Batch Forum
Topic: [Solved] preventing the call return
Replies: 10
Views: 8224

Re: [Solved] preventing the call return

' Maybe, but technically a crash is a crash, and an exit is an exit i tested you code in the prompt and it didn't exit the prompt and when i tested it in the batch file it prevents from returning to the call statement and it exit the batch file i tried to cause a crash with '????' is not recognized...
by allal
17 Jul 2011 04:12
Forum: DOS Batch Forum
Topic: [Solved] preventing the call return
Replies: 10
Views: 8224

Re: [Solved] preventing the call return

' An error is always shown on console but this will continue after the error returning to the call statement rem a happy crash to prevent returning for %%! in ( %%~ ) this code really disallow return to call statement but an accidental press will exit the console,furthermore it is like an emulation...
by allal
16 Jul 2011 14:49
Forum: DOS Batch Forum
Topic: [Solved] preventing the call return
Replies: 10
Views: 8224

Re: preventing the call return

aGerman wrote:Hmm, why can't you use EXIT then? It terminates the cmd process. What else should happen?


i don't want to exit as the error will not be shown to the user further more when the error is printed it must be printed in red color
by allal
16 Jul 2011 13:02
Forum: DOS Batch Forum
Topic: [Solved] preventing the call return
Replies: 10
Views: 8224

Re: preventing the call return

This code returns to the calling command, but exit /b 1 returns ErrorLevel 1, thats why goto :eof is executed. @echo off &setlocal call :label||goto :eof echo file exists pause goto :eof :label if not exist file.txt ( echo no such file &pause>nul exit /b 1 ) goto :eof Regards aGerman it is ...
by allal
16 Jul 2011 12:23
Forum: DOS Batch Forum
Topic: [Solved] preventing the call return
Replies: 10
Views: 8224

[Solved] preventing the call return

is there a way to prevent returning to calling command without using exit like call script.cmd rem we don't want to return here echo mission failed&goto :eof ::------------------------------------------------ rem we are in script.cmd goto label :label if not exist file.txt ( rem throw a terminat...
by allal
25 Jun 2011 05:05
Forum: DOS Batch Forum
Topic: AutoCom v1.0.0.1
Replies: 14
Views: 13113

Re: AutoCom v1.0.0.1

it gives the message autocom is not a valid 32 application
do you need auto it installed for it to work
by allal
23 Jun 2011 08:29
Forum: DOS Batch Forum
Topic: append lines of two files without a new line?
Replies: 16
Views: 14465

Re: append lines of two files without a new line?

for /f "tokens=*" %%a in (file1.txt) DO ( set /a counter1+=1 call set "array1-%%counter1%%=%%a" ) for /f "tokens=*" %%a in (file2.txt) DO ( set /a counter2+=1 call set "array2-%%counter2%%=%%a" ) if %counter1% GTR %counter2% (set counter=%counter1%) else set ...
by allal
23 Jun 2011 07:21
Forum: DOS Batch Forum
Topic: append lines of two files without a new line?
Replies: 16
Views: 14465

Re: append lines of two files without a new line?

@echo off set skip=0 for /f "usebackq tokens=*" %%a in (file1.txt) DO ( for /f "usebackq tokens=*" %%b in (file2.txt) DO ( echo %%a %%b >>f.txt goto file1 ) ) :file1 setlocal enabledelayedexpansion if %skip%==0 set skip=1 for /f "usebackq tokens=* skip=%skip%" %%a in (...
by allal
23 Jun 2011 05:45
Forum: DOS Batch Forum
Topic: append lines of two files without a new line?
Replies: 16
Views: 14465

Re: append lines of two files without a new line?

Code: Select all

for /f "usebackq tokens=*" %%a in (file1.txt) DO (
   call :file2 %%a
)


:file2
 for /f "usebackq tokens=*" %%b in (file2.txt) DO (
        do echo %1 %%b >>f
        exit /b
     )
by allal
23 Jun 2011 04:49
Forum: DOS Batch Forum
Topic: append lines of two files without a new line?
Replies: 16
Views: 14465

Re: append lines of two files without a new line?

Code: Select all

for /f "usebackq tokens=*" %%a in (file1.txt) DO (
    for /f "usebackq tokens=*" %%b in (file2.txt) DO (
        do echo %%a %%b >>f
     )
)
by allal
16 Jun 2011 05:31
Forum: DOS Batch Forum
Topic: [CONT] 8192
Replies: 18
Views: 13533

Re: [CONT] 8192

Cleptography wrote: I guess that is
what powershell is for. :P


yes powershell variable,arguments length can reach up to 2 billion character

what a difference