Quantcast
Channel: Microsoft Intune
Viewing all articles
Browse latest Browse all 1216

Intune problelm with create a folder if not exist and copy file to the folder

$
0
0

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


Viewing all articles
Browse latest Browse all 1216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>