Search found 70 matches

by mfm4aa
06 Mar 2013 12:49
Forum: DOS Batch Forum
Topic: Dos script error: identical result after some iterations
Replies: 2
Views: 2542

Re: Dos script error: identical result after some iterations

This can happen, if your filename contains more than 30 characters because you cut it.
by mfm4aa
05 Mar 2013 08:20
Forum: DOS Batch Forum
Topic: search list of strings in a file
Replies: 7
Views: 5054

Re: search list of strings in a file

There are some FINDSTR issues, e.g.
Recommendation - Always explicitly specify /L literal option or /R regular expression option when using "string argument" or /G:file.

http://stackoverflow.com/questions/8844 ... 73#8844873
by mfm4aa
05 Mar 2013 03:46
Forum: DOS Batch Forum
Topic: How to remove CR/LF in between the line
Replies: 26
Views: 29807

Re: How to remove CR/LF in between the line

CR/LF in the middle of a line? Please post such a line.
by mfm4aa
05 Mar 2013 03:06
Forum: DOS Batch Forum
Topic: search list of strings in a file
Replies: 7
Views: 5054

Re: search list of strings in a file

Your code is working for me. What kind of issue do you have?
by mfm4aa
05 Mar 2013 01:55
Forum: DOS Batch Forum
Topic: How to remove CR/LF in between the line
Replies: 26
Views: 29807

Re: How to remove CR/LF in between the line

Try this on the command line:

Code: Select all

>output.txt (for /f "tokens=*" %i in (input.txt) do @echo.%i)
by mfm4aa
01 Mar 2013 16:29
Forum: DOS Batch Forum
Topic: Ver check & install
Replies: 16
Views: 12052

Re: Ver check & install

You can create mathematical compareble version variables, e.g. @echo off &setlocal set "firefox=19.0.1" for /f "tokens=1-3delims=." %%i in ("%firefox%") do set "ht=000%%i"&set "tt=000%%j"&set "hh=000%%k" set "ht=%ht:~-3%&qu...
by mfm4aa
28 Feb 2013 11:03
Forum: DOS Batch Forum
Topic: Need Batch Script - New Question
Replies: 47
Views: 37397

Re: Need Batch Script - New Question

Try "dir /b /s /ad "Folder1\Folder">>"deletelog.log" before "rd".
by mfm4aa
22 Feb 2013 17:09
Forum: DOS Batch Forum
Topic: Copy file type from sub directories, into a folder renaming
Replies: 13
Views: 9767

Re: Copy file type from sub directories, into a folder renam

You can also check, if the file with the random number already exists: setlocal enabledelayedexpansion for /f "delims=" %%f in ('dir /a-d /b /s "%dSource%\%fType%"') do ( echo %%f if exist "%dTarget%\%%~nxf" ( :loop set "tname=%dTarget%\!random!.clg" if exist ...
by mfm4aa
22 Feb 2013 16:36
Forum: DOS Batch Forum
Topic: Copy file type from sub directories, into a folder renaming
Replies: 13
Views: 9767

Re: Copy file type from sub directories, into a folder renam

...It's not renaming any copies. Yes, try this: setlocal enabledelayedexpansion for /f "delims=" %%f in ('dir /a-d /b /s "%dSource%\%fType%"') do ( if exist "%dTarget%\%%~nxf" ( copy /v "%%~f" "%dTarget%\!random!!random!.clg" ) else ( copy /v "...
by mfm4aa
22 Feb 2013 16:11
Forum: DOS Batch Forum
Topic: Copy file type from sub directories, into a folder renaming
Replies: 13
Views: 9767

Re: Copy file type from sub directories, into a folder renam

Code: Select all

for /f "delims=" %%f in ('dir /a-d /b /s "%dSource%\%fType%"') do if not exist "%dTarget%\%%~nxf" (
    copy  /v "%%f" "%dTarget%\" 2>nul
)
by mfm4aa
22 Feb 2013 14:46
Forum: DOS Batch Forum
Topic: text find and replace scheduled task
Replies: 8
Views: 5301

Re: text find and replace scheduled task

This is from Google: http://www.dostips.com/?t=batch.findandreplace
please note the script output.
by mfm4aa
21 Feb 2013 18:51
Forum: DOS Batch Forum
Topic: Batch file help
Replies: 8
Views: 5390

Re: Batch file help

Thanks!
by mfm4aa
21 Feb 2013 18:28
Forum: DOS Batch Forum
Topic: Batch file help
Replies: 8
Views: 5390

Re: Batch file help

My suggestion:

Code: Select all

@echo off
:loop
if not "%1"=="" start /w "" "CompiledBinary.EXE" "%1"
shift
if not "%1"=="" goto :loop
by mfm4aa
21 Feb 2013 18:16
Forum: DOS Batch Forum
Topic: Prevent removing of blank lines....
Replies: 2
Views: 2712

Re: Prevent removing of blank lines....

One short suggestion: @echo off copy 2.txt 2.txt-backup setlocal enableDelayedExpansion >2.txt ( for /f "tokens=1*delims=:" %%A in ('type 2.txt-backup ^| findstr /n $') do ( ( echo !ln!| findstr "^Type=206$" >NUL && ( set ln=ln ) ) || ( set "ln=%%B" if "!ln...
by mfm4aa
19 Feb 2013 13:33
Forum: DOS Batch Forum
Topic: DOS script to rename filenames
Replies: 4
Views: 3833

Re: DOS script to rename filenames

Code: Select all

@echo off &setlocal ENABLEDELAYEDEXPANSION
for /f "delims=" %%i in ('dir /b "*.pdf"') do (
   Set "LIST=%%~i"
   Set "LIST=!LIST:'=_!"
   ren "%%~fi" "!LIST!"
)
endlocal



This will not work with =