Intune - Xcopy

Sokoban 1,061 Reputation points
2024-03-07T18:38:41.51+00:00

I have done batch file in intune to copy files to devices.

My batch file looks like that:

Xcopy thematrix.scr c:\windows\System32\ /s /h

It seems I need to have a permission to copy system32 folder

How I make permission to do that in my batch file ?

// Sokoban

Microsoft Security Intune Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. ZhoumingDuan-MSFT 17,165 Reputation points Microsoft External Staff
    2024-03-08T05:35:26.26+00:00

    @Sokoban,Thanks for posting in Q&A.

    From your description, I know you want to know what kind of permission do you need to copy a file to system32 folder.

    Based on my research, to copy files to the System32 folder using a batch file, you need the administrative permissions and if prompted by User Account Control, click Yes to grant the batch file administrative permissions on targeted device.

    Moreover, if you deploy the script via Intune, you should set Run this script using the logged on credentials No to run the script in system context.

    User's image

    Hope it will help.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Pavel yannara Mirochnitchenko 13,331 Reputation points MVP
    2024-03-10T11:36:57.61+00:00

    Just a side comment, I would transfer all these stuff into powershell and don't use batch or cmd scripts anymore. You can also log your powershell scripts which makes troubleshoting lot easier :)


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.