I try to use Intune to create a folder if not exist and copy file to the folder. I created a batch file:
xcopy /y testfile.txt %userprofile%\AppData\Roaming\Microsoft\Templates\Charts\
It works when I run this batch file on the local computer. But I convert the batch file to intunewin file and deploy with intune. It doesn't work.
After testing. I found the problem is intune can't use %userprofile% in batch file. If I change to:
xcopy /y testfile.txt c:\temp\Microsoft\Templates\Charts\
it works fine in intune.
So how do I use intune to copy file to %userprofile% folder?
Thanks