Skip to content

Windows File Association Guide

Version: 0.2

June 2025

Introduction

Purpose

ShArc uses the .sharc file extension for stub files in SharePoint, which reference files offloaded to Azure Blob Storage.

Users accessing these files through the Windows Explorer, when they are working with OneDrive for Business, can be supported by creating a file association redirecting them to a help page explaining how to access and restore files.

This document outlines the necessary steps for configuring and deploying this file association.

Audience

This guide is intended for IT administrators responsible for configuring and deploying file associations across an organization.

Configuring the File Association on an Individual Desktop Computer

The installation package includes a preconfigured registry file sharc-windows-file-association.reg, which can be used to create the file association.

Configuring the .reg File

Before applying the registry file, it must be adjusted:

  1. Open sharc-windows-file-association.reg in a text editor such as Notepad.
  2. Locate the last line of the file.
  3. Replace <Your-App-Service-Base-Name> with the actual name of your ShArc App Service.
  4. Save the changes.

Applying the .reg File

The file association can be applied by simply double-clicking the file.

Note: Administrator privileges are required to execute the .reg file.

Deploying File Association Configuration Across an Organization

For enterprise-wide deployment, the installation package includes a PowerShell script that applies the required ShArc file association settings to the Windows Registry.

Modifying the PowerShell Script

Before deployment, the script must be updated:

  1. Open sharc-windows-file-association.ps1 in a text editor such as Notepad.
  2. Locate line 3 of the script.
  3. Replace <Your-App-Service-Base-Name> with the actual name of your ShArc App Service.
  4. Save the changes.

Deployment Methods

The PowerShell script requires administrator (system) privileges for execution and can be deployed using:

  • Active Directory Group Policies (GPO)
  • Microsoft Intune
  • Other enterprise software deployment tools

This ensures a consistent rollout across all managed devices within the organization.

Microsoft Intune Deployment

Packaging the ShArc File Association for Intune Deployment

To deploy your ShArc file association configuration via Microsoft Intune, follow these steps to package your files using the Microsoft Win32 Content Prep Tool.

Packaging Steps

1. Prepare your files Place your updated PowerShell script (sharc-windows-file-association.ps1) and registry file (sharc-windows-file-association.reg) into a dedicated folder (e.g., C:\ShArcPackage).

⚠️ Important: Do not place the Win32 Content Prep Tool itself in this folder.

2. Download the Win32 Content Prep Tool Download the tool from GitHub and extract it to a separate location (e.g., C:\PrepTool).

3. Run the tool interactively Launch via Command Line IntuneWinAppUtil.exe to launch the interactive wizard.

When prompted:

  • Source folder: Enter the path to your prepared files (e.g., C:\ShArcPackage)
  • Setup file: Specify your PowerShell script (e.g., sharc-windows-file-association.ps1)
  • Output folder: Specify where the .intunewin file should be saved (e.g., C:\Output)
  • Catalog folder: Enter N (unless you have catalog files)

The tool will generate a .intunewin package in your output folder.

Intune Deployment Configuration

Upload to Intune

In the Microsoft Intune admin center:

  1. Go to Apps > All Apps > Add > Windows app (Win32)
  2. Upload your .intunewin file
Configure Installation Settings

Install command:

powershell.exe -ExecutionPolicy Bypass -File "sharc-windows-file-association.ps1"

Uninstall command:

powershell.exe -ExecutionPolicy Bypass -File "sharc-windows-file-association.ps1" -Uninstall

Install behavior: Select System

Device restart behavior: Choose No specific action

Detection Rule Configuration

Add a detection rule to ensure Intune can verify successful deployment.

Configure the registry detection rule as follows:

  • Rule type: Registry
  • Key path: HKEY_CLASSES_ROOT\.sharc
  • Value name: (leave blank)
  • Detection method: Key exists
  • Associated with a 32-bit app on 64-bit clients: No

Assignment

Target the relevant device or user groups for deployment.

Troubleshooting

Common Issues

  • Registry access denied: Ensure the script is running with administrator privileges
  • Intune deployment fails: Verify the detection rule is configured correctly
  • File association not working: Check that the App Service name has been properly updated in the configuration files

Verification Steps

  1. Check registry entry exists at HKEY_CLASSES_ROOT\.sharc
  2. Test file association by double-clicking a .sharc file
  3. Verify redirection to the correct help page URL

RELATED ARTICLES