Use a Win32 app to Copy Files and Folders

Here is a quick guide to create a Win32 app in Intune to copy som files and folders to your clients. In the example I had some tools I wanted to copy to all my lab machines and use Microsoft Intune to do so.

Source Folder

In this example I copied my files and folders to a source folder named E:\Demo\Intune\Win32Apps\Tools\Source. In addition to the Install.ps1 script that would copy the files, I also added in a Version001.txt script that I could use as my detection method in Intune, and an Uninstall.ps1 script that would delete the folder if I uninstalled the app.

You can download the sample scripts here: https://github.com/DeploymentResearch/DRFiles/tree/master/Scripts/Intune/Win32AppToCopyFiles

The source folder.

The Package

I used the Content Prep Tool to create the package needed for Win32 Apps in Intune. I used the following command:

.\IntuneWinAppUtil.exe -c "E:\demo\Intune\Win32Apps\Tools\Source" -s Install.ps1 -o "E:\demo\Intune\Win32Apps\Tools\Package" -q

Creating the Win32 App in Intune

When creating the Win32 App in Intune, I used the following settings:

Name: ViaMonstra Lab Tools
Description: ViaMonstra Lab Tools
Publisher: ViaMonstra
Install Command line: powershell.exe -ExecutionPolicy Bypass -File Install.ps1
Uninstall Command line: powershell.exe -ExecutionPolicy Bypass -File Uninstall.ps1
File detection rule: Version001.txt in C:\Tools
Assignment: An Azure AD Group with my lab machines, assignment configured for foreground download.

About the author

Johan Arwidmark

5 1 vote
Article Rating
Subscribe
Notify of
guest
8 Comments
Newest
Oldest Most Voted
Michael Johansen
Michael Johansen
2 years ago

Hi Johan,
Thanks for sharing this. Is there a way to hide the install and uninstall scripts so they are not visible within the folder or some other way of not copying the scripts as part of the package.

anjali
anjali
2 years ago

It didn't help me. I followed the instructions but it is failing.
can you please suggest

Nas
Nas
3 years ago

Thanks for the information.Version001.txt 

What was the content of the

Rob
Rob
3 years ago

It works !! Great, thanks a lot

Ryan M
Ryan M
3 years ago

I used this today as part of a kiosk setup. Very handy, thanks Johan!

Iver
Iver
3 years ago

Thank you. Great guide. It works.


>