1

I have a folder containing 1000+ xml files. I need to modify these xml files, for which I am using xslt.

Now the problem that I am facing is that I want to use batch script to do this modification recursively for all the xml files in the folder, rather than doing it manually. How can I do it using batch script?

It would be helpful if anybody could tell me how can I read all the xml files present in a folder and copy them to another folder with the same name.

1

3 Answers 3

6

Transformation:

for /r c:\your_root_folder\ %f in (*.xml) do your_transform_command %f

Copy:

copy *.xml c:\your_target_folder\.
Sign up to request clarification or add additional context in comments.

1 Comment

NOTE: You'll need to use %%f inside a batch file.
0

Assuming you are using DOS batch ...

A simple copy operation will work:

prompt> copy *.xml destinationDir

To loop and process files individually, we use:

for %%R in (*) do (
  ...
)

Comments

0

read this

HELP XCOPY,

and this

HELP FOR.

and try this

XCOPY \source\*.xml \destination /S

and try this

FOR %a IN (\source\*.xml) DO echo %a

and now read

HELP CALL

and read

HELP SET

and try this

FOR %a in (\source\*.xml) DO CALL youraction %~na

and by the time you understand what happened you are ready to achieve your goal.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.