cmd.exe C:\Windows\System32\cmd.exe /c "mkdir %temp%\T1222.001_attrib &amp; echo T1222.001_attrib1 &gt;&gt; %temp%\T1222.001_attrib\T1222.001_attrib1.txt &amp; echo T1222.001_attrib2 &gt;&gt; %temp%\T1222.001_attrib\T1222.001_attrib2.txt &amp; attrib.exe +r %temp%\T1222.001_attrib\T1222.001_attrib1.txt &amp; attrib.exe +r %temp%\T1222.001_attrib\T1222.001_attrib2.txt" powershell.exe ar-win-2.attackrange.local