Output PSEXEC Batch file result to text file

Parent, Rémi RP [NC] 1 Reputation point
2022-04-14T13:10:54.957+00:00

I created a very simple batch file to disable Hyper-V on multiple PCs on our network. My batch file is located on my c:\temp\DisableHyperV.bat and contains one line of text "193098-image.png

I created a text file at c:\temp\PC_List.txt which contains all computers (one on each line)

If I run the following: PsExec.exe @c:\temp\PC_List.txt -h -u domain_name\Admin_Account_Name -c c:\temp\DisableHyperV.bat it works great! it runs the batch file on each computers from the text file and displays success or failure for each on the command prompt screen. But I would like if possible to output that information in a text file and I fail to get this done. Tried multiple syntax to no avail.

I thought this would have worked: PsExec.exe @c:\temp\PC_List.txt -h -u domain_name\Admin_Account_Name -c "c:\temp\DisableHyperV.bat > c:\temp\results.txt"

Azure Batch
Azure Batch
An Azure service that provides cloud-scale job scheduling and compute management.
374 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.