Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using following script but it is giving syntax error. Can somebody tell me what is the issue here?

@echo off
SETLOCAL EnableDelayedExpansion
SET test=
dir /s /-c /a | find "Directory" >> path.txt
for /f "tokens=* delims= " %%a IN (path.txt) do
(
Set test=%%a
Set test=%test:Directory of =%
echo !test!
)
share|improve this question
Where does it give the error? – Luke Oct 9 '12 at 21:06
when I try to run it, it says "There is an error in the syntax" – Sachin Oct 10 '12 at 14:29

closed as off topic by Renan, techie007, 8088, Luke, soandos Oct 10 '12 at 0:12

Questions on Super User are expected to relate to computer software or computer hardware within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

up vote 2 down vote accepted

I got the answer myself:

for /f "tokens=1,2 delims=C" %%a IN ('"dir /s /-c /a | find "Directory""') do (echo C%%b >> abcd.txt)
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.