Tech Accelerator: Microsoft Intune Suite
Apr 11 2023 08:00 AM - Apr 12 2023 11:00 AM (PDT)

Correct App detection rule File Path for User Folder

Occasional Contributor

Hi Guys,


I have deployed a file to the user's folder, but I don't think I have the correct syntax for the "Current User", I have tried:





But Intune doesn't like them as it is showing that it has failed even though it has deployed the file in the correct folder. Below is the detection rule file path. Does anyone know what the correct syntax for the current user is? Many thanks, Tung


Screenshot 2022-06-27 at 15.01.38.png

11 Replies
best response confirmed by TungNguyen1600 (Occasional Contributor)

Detection rules run as SYSTEM, not as user even if you deploy it as a user package. You have to use something outside a Users folder to detect the installation, I usually create a file in c:\programdata\customername\...\installed.txt and check on that to see if the installation succeeded

@Harm_Veenstra Ahh makes sense. No wonder I couldn’t find much documentation on it. Do you have any doc that states the detection rule is on the system level? And thanks for the tip too!

It doesn't really mention it on , but it's just the way it works I'm afraid (Many people ask for user level detection rules).

Please mark my answer as solution to mark it as solved.

Ok thanks so much for your response and help!

Hi@TungNguyen1600 ,

I have exactly the same VPN client to deploy in Intune but none of my scripts/win32app worked.


Would you mind sharing your settings please?







I was playing around with a win32app that got installed in the USER context ... ANd just adding a %username% in the detection rule... first it indeed tries to find it as system


Of course that would just fail



But it seems it also tries to find it as user if the system detection fails... and by the looks of it ... it succeeds






Ok.. What? Is this something new?! I'm sure I tested this multiple times in the past and read that detection is done by system
I know.... everywhere I am reading the same explanation.... so I was flabergasted to see this message in the IME :)
Could you share how you configured the win32app

Install as user or system?
What did you configured as detection rule?

Hello @Rudy_Ooms_MVP ,

Thanks for your reply.


I finally made it work!


These are my settings:




And the script is:


As I needed to copy the whole folder.


Interesting is if I set the install behaviour as System context, Intune will create another "user" (in users folder) with the device's name.


Thanks a gain!



Hi, yep thats the behavior that is expected when looking at the ime flow and how it tries to install/detect the app.

As mentioned in the reply above , the use rname variable works when choosing the user context.