Page 1 of 1

dos variable

Posted: 20 Oct 2009 03:35
by zackysue
Hi guys,

Im having problem to open and print in notepad using batch command
if i using variable

the scenario is
My first batch is runnig which is..
"for %%x in ("c:\temp\A\"*.txt) do start /wait notepad /P %%x"
comment---it will print all the textfile inside the A folder..fine--

but my second batch is not running which is
for /f "eol=; tokens=1,2,* delims=," %%i in (runnning.csv) do start /wait notepad /P c:\temp\%%i\*.txt
comment-- i want to make folder A as a variable .the batch can read the variable but failed to open and print any textfile inside the folder (which is i variable)..

Any ideas guys .i'm running out of idea..

Posted: 20 Oct 2009 18:13
by avery_larry
It's a little hard to understand what you want, but I think if:

Code: Select all

"for %%x in ("c:\temp\A\"*.txt) do start /wait notepad /P %%x" 


is working for you, then you should be able to do it again for the 2nd part like this:


Code: Select all

for /f "eol=; tokens=1,2,* delims=," %%i in (runnning.csv) do (
   for %%m in ("c:\temp\%%i\*.txt") do start /wait notepad /P %%m
)

Posted: 20 Oct 2009 18:53
by zackysue
thank a lot
avery,

finally problem solved..

thank again for saving my time and i can run the batch with succesfully...
:lol: