Search found 70 matches
- 31 Mar 2013 16:31
- Forum: DOS Batch Forum
- Topic: echo. with curious output
- Replies: 9
- Views: 6664
echo. with curious output
Hi, I have a curious output with the echo command in XP. I have the following folders & files: C:\TEST ├───folder1 │ file1.iso │ ├───folder10 │ file10.iso │ ├───folder2 │ file2.iso │ ├───folder3 │ file3.iso │ ├───folder4 │ file4.iso │ ├───folder5 │ file5.iso │ ├───folder6 │ file6.iso │ ├───folde...
- 27 Mar 2013 06:00
- Forum: DOS Batch Forum
- Topic: Need to launch BIOS update files
- Replies: 29
- Views: 22446
- 27 Mar 2013 05:33
- Forum: DOS Batch Forum
- Topic: Need to launch BIOS update files
- Replies: 29
- Views: 22446
Re: Need to launch BIOS update files
Did you make it with goto: ?
- 27 Mar 2013 05:20
- Forum: DOS Batch Forum
- Topic: Need to launch BIOS update files
- Replies: 29
- Views: 22446
Re: Need to launch BIOS update files
Try to remove the double quotes around %%b:
Code: Select all
@echo off
set "pa="
set /p "pa=PA Number: "
if defined pa (
for /f "usebackq tokens=1,* delims=|" %%a in ("%~dp0file.txt") do (
if /i "%%a"=="%pa%" %%b
))
- 27 Mar 2013 04:28
- Forum: DOS Batch Forum
- Topic: Need to launch BIOS update files
- Replies: 29
- Views: 22446
Re: Need to launch BIOS update files
I have an other idea. Put the file.txt and the batch in the same folder and try this: @echo off set "pa=" set /p "pa=PA Number: " if defined pa ( for /f "usebackq tokens=1,* delims=|" %%a in ("%~dp0file.txt") do ( if /i "%%a"=="%pa%" "...
- 26 Mar 2013 15:40
- Forum: DOS Batch Forum
- Topic: For loop to hit each user on a machine
- Replies: 33
- Views: 22444
Re: For loop to hit each user on a machine
The for loop always goes for in () do.
- 26 Mar 2013 13:33
- Forum: DOS Batch Forum
- Topic: Rename Epub files
- Replies: 4
- Views: 5196
Re: Create a bat-file
How do you open *epub to see *opf & inside *opf the info?
- 26 Mar 2013 12:33
- Forum: DOS Batch Forum
- Topic: For loop to hit each user on a machine
- Replies: 33
- Views: 22444
- 26 Mar 2013 10:57
- Forum: DOS Batch Forum
- Topic: How to use function in function library ?
- Replies: 4
- Views: 4520
Re: How to use function in function library ?
What is the error message?
- 24 Mar 2013 13:30
- Forum: DOS Batch Forum
- Topic: Put variable in options of for loop, for "skip=" value, but
- Replies: 4
- Views: 5638
Re: Put variable in options of for loop, for "skip=" value,
pditty8811 wrote:So I have to assign the variable outside of the loop, in order for it to work?
Yes, as I did say before.
- 24 Mar 2013 13:28
- Forum: DOS Batch Forum
- Topic: How do I state that a variable is a date?
- Replies: 7
- Views: 8915
Re: How do I state that a variable is a date?
Very helpful, thank you. But shoudn't it be:
Code: Select all
set /A DOW=(JDN+1) %% 7
The date 2013/03/24 was Monday
- 23 Mar 2013 23:51
- Forum: DOS Batch Forum
- Topic: How do I state that a variable is a date?
- Replies: 7
- Views: 8915
Re: How do I state that a variable is a date?
Batch doesn't have a "Date2Number" function, so you have to write your own.
- 23 Mar 2013 12:01
- Forum: DOS Batch Forum
- Topic: Having for loop reference findstr result, moving two lines d
- Replies: 16
- Views: 13377
Re: Having for loop reference findstr result, moving two lin
Mmm, the code bricks, if %search% found on line 2 and %updown%=-1 Pattern: [mysearch] found at line 2 in file.txt Target line below zero So it needs a (hopefully ) last modification: @echo off &setlocal set "fname=%~1" if not exist "%fname%" echo File %fname% not found!&g...
- 23 Mar 2013 09:40
- Forum: DOS Batch Forum
- Topic: Having for loop reference findstr result, moving two lines d
- Replies: 16
- Views: 13377
Re: Having for loop reference findstr result, moving two lin
Really nice and fast
- 23 Mar 2013 08:06
- Forum: DOS Batch Forum
- Topic: Having for loop reference findstr result, moving two lines d
- Replies: 16
- Views: 13377
Re: Having for loop reference findstr result, moving two lin
Search in a file and find lines up or down (e.g. 2 lines up-->updown=-2 / 2 lines down-->updown=2): @echo off &setlocal set "fname=file.txt" set "search=mysearch" set /a updown=2 set "skip0=" set /a skipcount=0 :findloop set "count=" for /f "%skip0%to...