Saved Bookmarks
| 1. |
Solve : Simple batch file help?!? |
|
Answer» This doesn't work correctly: set %X%=%1 It doesn't work like that The format i have is correct: set A=1 set B=2 set C=3 echo %a%+%b%=%c% The COMMANDS i have are not wrong, they simply don't work in the way i have them.bump also. let me re articulate the BANE of my week. echo off dir /B *.txt pause > nul this lists the text file names in the current directory (Assuming there are 2 txt files in the directory) What i want is so that the first file listed is "set" to something, and the second file is "set" to something else. help appreciated and desperately needed. As you are desperate here's an untested script, hope it helps: Code: [Select]echo off cls setlocal enabledelayedexpansion for /f "tokens=*" %%1 in ('dir /b *.txt') do ( set filename=%%1 & call :increment ) pause > nul exit /b :increment set /anbr+=1 if %nbr% EQU 1 ( set X=!filename! ) else ( set Y=!filename! ) if !nbr! lss 2 (goto :eof ) else ( echo X=!X! Y=!Y! ) Quote from: Dusty on April 08, 2010, 02:56:11 AM As you are desperate here's an untested script, hope it helps: WOW thank you for that Now i just need to familiarize myself with this NEW format, a bit advanced for me, but i will work at it. Much thanx :] |
|