Search found 378 matches

by !k
21 Dec 2011 14:07
Forum: DOS Batch Forum
Topic: Get last string after delimiter FOR /F
Replies: 3
Views: 6056

Re: Get last string after delimiter FOR /F

or

Code: Select all

call :name "C:\WINDOWS\Web\Wallpaper"
call :name "C:\Users\[username]\Desktop\Example Folder\Example Folder 2"
goto :eof

:name
echo name = %~nx1
goto :eof
by !k
20 Dec 2011 15:16
Forum: DOS Batch Forum
Topic: Strange behavior
Replies: 4
Views: 1814

Re: Strange behavior

roy437
use setlocal enabledelayedexpansion and !variable!

Tesrym
read set/? about "0" and "0x" prefix
by !k
20 Dec 2011 14:59
Forum: DOS Batch Forum
Topic: SET Command
Replies: 7
Views: 2710

Re: SET Command

del
by !k
08 Dec 2011 12:53
Forum: DOS Batch Forum
Topic: Echo results of FOR /F loop on one line
Replies: 2
Views: 1639

Re: Echo results of FOR /F loop on one line

Code: Select all

setlocal enabledelayedexpansion
set "$="
for /f "usebackq delims=" %%a in ("text.txt") do set "$=!$!%%a"
echo:!$!

:?:
by !k
07 Dec 2011 14:54
Forum: DOS Batch Forum
Topic: Searching Double quote using FINDSTR inside FOR
Replies: 4
Views: 2732

Re: Searching Double quote using FINDSTR inside FOR

FOR /f "tokens=1 delims=:" %a in ('FINDSTR /n /c:^"^"^" s.txt') do echo %a
by !k
06 Dec 2011 11:39
Forum: DOS Batch Forum
Topic: Speed Writing a File
Replies: 17
Views: 7410

Re: Speed Writing a File

more/? wrote:+n : Start displaying the first file at line n

more +10 will start display that batch at line №10
by !k
06 Dec 2011 11:28
Forum: DOS Batch Forum
Topic: Speed Writing a File
Replies: 17
Views: 7410

Re: Speed Writing a File

read more/?
by !k
06 Dec 2011 08:42
Forum: DOS Batch Forum
Topic: Speed Writing a File
Replies: 17
Views: 7410

Re: Speed Writing a File

@echo off >myFile.txt more +10 %0 for /f %%z in ("myFile.txt") do if not "%%~zz"=="23" (echo:Wrong myFile.txt!&pause&exit) :: Your code is here :: Your code is here goto :eof :: 10th line of batch Line1 Line2 Line4
by !k
04 Dec 2011 14:50
Forum: DOS Batch Forum
Topic: How to get EVERY file in DIR including a file number
Replies: 24
Views: 7803

Re: How to get EVERY file in DIR including a file number

Where is Image ?!

AND

20+12+10+93+10+44+20+7+1+81+67+30+7 = 402
by !k
04 Dec 2011 14:02
Forum: DOS Batch Forum
Topic: How to get EVERY file in DIR including a file number
Replies: 24
Views: 7803

Re: How to get EVERY file in DIR including a file number

http://blogs.westword.com/latestword/assets_c/2009/10/LieToMe-thumb-510x279.jpg http://www.dostips.com/forum/viewtopic.php?p=11763#p11763 or simple setlocal for /f "tokens=1-3" %%x in ('dir /a-d/s/-c %1 2^>nul ^|findstr /c:"File(s)"') do set "num=%%x" echo %num% files ...
by !k
04 Dec 2011 06:49
Forum: DOS Batch Forum
Topic: How to get EVERY file in DIR including a file number
Replies: 24
Views: 7803

Re: How to get EVERY file in DIR including a file number

It's really dir/S ? Not simple "dir" ?
by !k
04 Dec 2011 05:54
Forum: DOS Batch Forum
Topic: How to get EVERY file in DIR including a file number
Replies: 24
Views: 7803

Re: How to get EVERY file in DIR including a file number

drgt wrote:C:\>echo !num! files
files
give me dir/s output (last 3 lines) pliz
by !k
04 Dec 2011 01:38
Forum: DOS Batch Forum
Topic: How to get EVERY file in DIR including a file number
Replies: 24
Views: 7803

Re: How to get EVERY file in DIR including a file number

hidden & system files? setlocal enabledelayedexpansion set "all=0" for /f "tokens=1-3" %%x in ('dir /a-d/s/-c 2^>nul ^|findstr /c:"File(s)" /c:"Total Files"') do ( if "!all!"=="1" set "num=%%x" if "%%x %%y"=="To...
by !k
27 Nov 2011 01:29
Forum: DOS Batch Forum
Topic: Value of the value set to a variable?
Replies: 5
Views: 2881

Re: Value of the value set to a variable?

Cat wrote:None of the above works.
it works for me

Code: Select all

setlocal enabledelayedexpansion
set test=96
set /p 96="random prompt : "
if "!%test%!" == "7" echo Seven
___________
XP SP3 x32