# Copy file to workstations with Windows Intune

Seems one of the only ways to copy files to PC’s in Intune seems to be to create an MSI file to deploy them. However this can also be done using Windows app (Win32)

Copy.bat File

rem Copy Files
copy off.ini c:\Windows\System32\off.ini
copy BSPECIAL.DLL c:\Windows\System32\BSPECIAL.DLL
copy BSPECIAL.DLL c:\Windows\SysWOW64\BSPECIAL.DLL
rem Set Permissions
icacls "c:\Windows\System32\BSPECIAL.DLL" /grant Everyone:M
icacls "c:\Windows\SysWOW64\BSPECIAL.DLL" /grant Everyone:M

del.bat file

del c:\Windows\System32\off.ini
del c:\Windows\System32\BSPECIAL.DLL
del c:\Windows\SysWOW64\BSPECIAL.DLL

Next run the IntuneWinAppUtil.exe File

c:\TempPath\Intune-Win32-App-Packaging-Tool-master>IntuneWinAppUtil.exe
Please specify the source folder: F:\Config Files
Please specify the setup file: copy.bat
Please specify the output folder: C:\TempPath\BuildsoftAppps

Create a new Windows app (Win32) App in Intune , upload the copy.intunewin and use the commands below

Detection Rules

VN:F [1.9.22_1171]
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

# How to diagnose issues with Powershell Scripts Running in Intune

Following on from this great article

The Powershell Script History and logs are stored in the following registry location

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IntuneManagementExtension\Policies

You will need to navigate to a subtree in their GUID

## Diagnosing Failures

A result was coming Failed with the below

ï¿½ï¿½$: The term 'ï¿½ï¿½$' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.At C:\Program Files (x86)\Microsoft Intune Management Extension\Policies\Scripts\ee7f18e5-b666-4c11-be72-9d5490a49e23_a39275a0-659c-45a9-9f1a-d312ae484eda.ps1:1 char:1+ ï¿½ï¿½\$

On running the scripts get copied here briefly then run and deleted : C:\Program Files (x86)\Microsoft Intune Management Extension\Policies\Scripts

You have to be fast but you can copy the .ps1 file to e.g. C:\Temp and check what the machine was getting , to resolve this issue I had to recopy the file into Powershell ISE and resave and upload.

### How to Run the Scripts Manually

Change DownloadCountand ErrorCode to 0 and set Result and ResultDetails to nothing (empty string). After this we just restart the Microsoft Intune Management Extension Service (IntuneManagementExtension) and the script will rerun again on this device

### Log Directory

C:\ProgramData\Microsoft\IntuneManagementExtension\Logs

VN:F [1.9.22_1171]