Search found 115 matches

by Yury
02 Jun 2014 12:24
Forum: DOS Batch Forum
Topic: Function - read text file and preserve line read
Replies: 9
Views: 7411

Re: Function - read text file and preserve line read

Code: Select all

  if /i NOT "%%b"=="WinSxS" echo !val1!>>%tmp%\SplitPath.txt
by Yury
02 Jun 2014 06:09
Forum: DOS Batch Forum
Topic: Function - read text file and preserve line read
Replies: 9
Views: 7411

Re: Function - read text file and preserve line read

dbenham wrote:No batch script required.

Code: Select all

find /vi "C:\Windows\WinSxS\" "%tmp%\ExePath1.txt" >"%tmp%\SplitPath.txt"


The fourth way. :)
by Yury
02 Jun 2014 03:09
Forum: DOS Batch Forum
Topic: A batch file speaking!
Replies: 10
Views: 13091

Re: A batch file speaking!

One more method: @echo off call :speak "Hello_%username%!_Type_Q_to_quit." echo Quotation marks in the beginning of the text not allowed! echo. :begin set /p "spk=Speak: " if /i "%spk:~0,1%" equ "Q" exit /b set "spk=%spk: =_%" set "spk=%spk:&quo...
by Yury
02 Jun 2014 00:15
Forum: DOS Batch Forum
Topic: Function - read text file and preserve line read
Replies: 9
Views: 7411

Re: Function - read text file and preserve line read

Third way: @ECHO OFF>%tmp%\SplitPath.txt for /f "tokens=*" %%a in (%tmp%\ExePath1.txt) do ( Call :MySplitPath %%a ) echo. echo This is the End of code. pause rem "exit" or "goto:eof" exit /b :MySplitPath %1 set val1=%* rem "<nul set /p="..."& echo.&qu...
by Yury
02 Jun 2014 00:00
Forum: DOS Batch Forum
Topic: Function - read text file and preserve line read
Replies: 9
Views: 7411

Re: Function - read text file and preserve line read

Second way: @ECHO OFF>%tmp%\SplitPath.txt for /f "tokens=*" %%a in (%tmp%\ExePath1.txt) do ( Call :MySplitPath %%a ) echo. echo This is the End of code. pause rem "exit" or "goto:eof" exit /b :MySplitPath %1 set val1=%* rem "SETLOCAL ENABLEDELAYEDEXPANSION" an...
by Yury
01 Jun 2014 23:38
Forum: DOS Batch Forum
Topic: Function - read text file and preserve line read
Replies: 9
Views: 7411

Re: Function - read text file and preserve line read

There are several ways to fix thеsе errors. First way: @ECHO OFF>%tmp%\SplitPath.txt for /f "tokens=*" %%a in (%tmp%\ExePath1.txt) do ( Call :MySplitPath %%a ) echo. echo This is the End of code. pause rem "exit" or "goto:eof" exit /b :MySplitPath %1 set val1=%* rem One...
by Yury
01 Jun 2014 01:25
Forum: DOS Batch Forum
Topic: list all folders and subfolders to an list.txt file
Replies: 2
Views: 3471

Re: list all folders and subfolders to an list.txt file

More correctly: setlocal enabledelayedexpansion echo Ver:24 >%PATCHER_FOLDER%\list.txt ( echo C:\\RESCLIENT echo. @for /f "tokens=1-5* delims=/-. " %%i in (' dir /o-g /s^| findstr /bvc:" "^| findstr /ev \. ') do @( if not "%%m"=="<DIR>" ( set size= %%m set siz...
by Yury
31 May 2014 21:00
Forum: DOS Batch Forum
Topic: list all folders and subfolders to an list.txt file
Replies: 2
Views: 3471

Re: list all folders and subfolders to an list.txt file

setlocal enabledelayedexpansion echo Ver:24 >%PATCHER_FOLDER%\list.txt ( echo C:\\RESCLIENT echo. @for /f "tokens=1-5* delims=/-. " %%i in (' dir /o-g /s^| findstr /bvc:" "^| findstr /ev \. ') do @( if not "%%m"=="<DIR>" ( set size= %%m set size=!size:~-20! i...
by Yury
28 Dec 2013 16:00
Forum: DOS Batch Forum
Topic: Batch file to open windows explorer to last created file
Replies: 34
Views: 25325

Re: Batch file to open windows explorer to last created file

It doesnt open files. <...> Applications open files <...>. Yes, it is true, but... Compare results of execution of these 2 batch files: @echo off copy nul File_with_extension.txt>nul File_with_extension.txt exit @echo off copy nul File_with_extension.txt>nul explorer File_with_extension.txt exit Th...
by Yury
28 Dec 2013 08:11
Forum: DOS Batch Forum
Topic: 1st Line of Text Shows < >
Replies: 11
Views: 7568

Re: 1st Line of Text Shows < >

berserker wrote:can this ignore blank first line?


Try:

Code: Select all

@echo off
for /f "delims=" %%a in (c:\temp1\Login.txt) do (
 set /p line1="%%a" 0>nul
 echo.
 goto:pause
)
:pause
pause>nul