# How to batch insert all image files in a specified folder?

**URL:** <https://community.wolfram.com/t/how-to-batch-insert-all-image-files-in-a-specified-folder/26592>\
**Category:** Questions\
**Tags:** mathematica, import-and-export\
**Created:** [March 15, 2026, 12:17pm UTC](https://community.wolfram.com/t/how-to-batch-insert-all-image-files-in-a-specified-folder/26592 "2026-03-15T12:17:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmamathes](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@mmamathes](https://community.wolfram.com/u/mmamathes)\
**Post date:** [March 15, 2026, 12:17pm UTC](https://community.wolfram.com/t/how-to-batch-insert-all-image-files-in-a-specified-folder/26592/1 "2026-03-15T12:17:13Z")

</div>

![屏幕截图2026-03-15201412.png](https://global.discourse-cdn.com/wolfram/original/3X/5/f/5f6fb811fcec783300bf3652bc13407597ab977b.png)

Usually, we insert a small number of images in a notebook using the method shown in the figure. If there are many images to insert, what method can be used to insert all image files in a certain folder at once?

---

<div class="post-metadata">

**Author:** ![mroge02](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mroge02/32/28775_2.png) [@mroge02](https://community.wolfram.com/u/mroge02)\
**Post date:** [March 15, 2026, 1:00pm UTC](https://community.wolfram.com/t/how-to-batch-insert-all-image-files-in-a-specified-folder/26592/2 "2026-03-15T13:00:21Z")

</div>

One idea would be to loop over the list of filenames in `FileNames[All, dir]` and use one of the following to write into the notebook:

```
CellPrint[ExpressionCell[Import[filename], "Input"]]

NotebookWrite[EvaluationNotebook[], 
 Cell[BoxData[Import[filename] // MakeBoxes[#, StandardForm] &], "Input"]]

```

And it does not have to be in `"Input"` style, but that’s what the menu command does.

One could also use

```
CopyToClipboard[DocumentNotebook[listOfImageCells]]

```

where `listOfImageCells` is computed from looping through filenames and has the form

```
{ExpressionCell[img1, "Input"], ExpressionCell[img2, "Input"],…}

```

After copy, then paste. It should paste each cell separately if the insertion point is between cells. Maybe beware the total size of the images.

---

<div class="post-metadata">

**Author:** ![dtrimas](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dtrimas/32/18502_2.png) [@dtrimas](https://community.wolfram.com/u/dtrimas)\
**Post date:** [March 16, 2026, 3:32pm UTC](https://community.wolfram.com/t/how-to-batch-insert-all-image-files-in-a-specified-folder/26592/3 "2026-03-16T15:32:10Z")

</div>

Assuming they’re all of the same file extension, you can use the `*` character to get all the files of a given extension in a directory. For example if they were PNG images

```
Import[FILEPATH, "*.png"]

```

Be careful to note that this will extract all PNG images at any level, even within subdirectories of `FILEPATH`. If you only want files explicitly in `FILEPATH` you can append `*.png` to the `FILEPATH`:

```
Import[FileNameJoin[{FILEPATH, "*.png"}]]

```
