You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It works in Windows 10 22H2 but should work in Windows 11, too.
Save the 2 files below then follow the How to Install section.
Save as IntuneWin File right-click.ps1
<#
.SYNOPSIS
Creates an .IntuneWin File by right-clicking on the source folder.
.DESCRIPTION
This script runs the Microsoft-Win32-Content-Prep-Tool from Windows explorer by right-clicking on the source folder
The source folder name will determine the name of the .IntuneWim file
The .IntuneWim file will be created in the PARENT FOLDER of the Source Folder.
How to Install:
0-Create C:\Program Files\Win32-Content-Prep-Tool\ folder
1-Copy the Microsoft-Win32-Content-Prep-Tool files to C:\Program Files\Win32-Content-Prep-Tool\
2-Copy this PS1 script to the same folder
3-Import "Create .IntuneWin File right-click.Reg" file into the registry
How to use:
1-Create your Intune package as normal
2-When done, Right-Click on the target folder and select: "Create .IntuneWin File with this folder"
3-A GUI will popup for you to select the Install Setup file (e.g. setup.exe or setup.msi or .CMD or .PS1).
4-The .IntuneWim file will be created in the PARENT FOLDER of the selected Source folder
.NOTE
You can copy the files to a different location but you'll need to edit the REG file to match
The Right-Click needs to have a static location for the EXE and PS1 files.
CAVEATS of the IntuneWinAppUtil.exe:
If the output file already exists, it is overwritten.
If the output folder doesn't exist, it's created automatically.
Licence: MIT (Free for all uses)
#>
[CmdletBinding()]
Param (
[Parameter(Mandatory = $false)]
[String]$SourceFolder
)
Try {
Write-host "`$SourceFolder [$SourceFolder]"
[string]$DP0=[System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.path)
[String]$IntuneWinExePath = "$DP0\IntuneWinAppUtil.exe"
[String]$OutFolder = [System.IO.Path]::GetDirectoryName($SourceFolder)
[string]$ScriptNameBase=($MyInvocation.MyCommand.Name).Replace(".ps1","")
Write-host "`$OutFolder [$OutFolder]"
#Note: The dialog may appear in the background (behind the PowerShell console).
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$oOpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog
$oOpenFileDialog.Title = "[$ScriptNameBase] Select Install script or EXE"
$oOpenFileDialog.InitialDirectory = $SourceFolder
$oOpenFileDialog.ShowHelp=$true
If($oOpenFileDialog.ShowDialog() -eq "OK") {
$sfile=$oOpenFileDialog.FileName
Write-host "You selected [$sfile]"
Start-Sleep -Second 6
}
Else {
Write-host "You picked nothing" #user clicked Cancel
Start-Sleep -Second 6
$sfile = "$SourceFolder\DontExist.exe"
}
#Write-host "`$sFile [$sfile]"
#Launch IntuneWinAppUtil.exe in the same folder as this script
. "$IntuneWinExePath" -c "$SourceFolder" -s "$sfile" -o "$OutFolder"
Write-host "Complete. Press Enter to close"
Pause
} Catch {
[String]$ErrorMessage = @{'Message:' = "$($_.Exception.Message)";'ScriptStackTrace:'="$($_.ScriptStackTrace)";'InnerException:'="$($_.Exception.InnerException)"} `
| Format-Table -AutoSize -Wrap -HideTableHeaders | Out-String
Write-host $ErrorMessage
Pause
}
.
Save as IntuneWinAppUtil.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\IntuneWinAppUtil]
@="Create .IntuneWin File with this folder"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\IntuneWinAppUtil\Command]
@="Powershell.exe -file \"C:\\Program Files\\Win32-Content-Prep-Tool\\IntuneWin File right-click.ps1\" %1"
The text was updated successfully, but these errors were encountered:
This is what it looks like:
It works in Windows 10 22H2 but should work in Windows 11, too.
Save the 2 files below then follow the How to Install section.
Save as IntuneWin File right-click.ps1
.
Save as IntuneWinAppUtil.reg
The text was updated successfully, but these errors were encountered: