cmd.exe "cmd.exe" /c "mkdir %%temp%%\T1222.001_takeown_folder &amp; echo T1222.001_takeown1 &gt;&gt; %%temp%%\T1222.001_takeown_folder\T1222.001_takeown1.txt &amp; echo T1222.001_takeown2 &gt;&gt; %%temp%%\T1222.001_takeown_folder\T1222.001_takeown2.txt" powershell.exe ar-win-dc.attackrange.local