dos variable

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
zackysue
Posts: 4
Joined: 20 Oct 2009 03:19
Location: kuala lumpur
Contact:

dos variable

#1 Post by zackysue » 20 Oct 2009 03:35

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..

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#2 Post by avery_larry » 20 Oct 2009 18:13

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
)

zackysue
Posts: 4
Joined: 20 Oct 2009 03:19
Location: kuala lumpur
Contact:

#3 Post by zackysue » 20 Oct 2009 18:53

thank a lot
avery,

finally problem solved..

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

Post Reply