How to execute a batch (.bat) file in a remote windows machine?

To execute a batch file in a remote windows machine, there is an utility provided by Microsoft. The utility is PsExec.

You can download the zip file with the utility from Microsoft from the URL

You need to unzip and get the 64/32 bit file based on your system architecture.

Initially, the utility needs you to accept the EULA.

For this, you can execute the utility with the -accepteula flag.

C:\PsExec64.exe -accepteula

This is a one-time process and after that you will be able to call the exe file and run applications in remote machine

After that EULA is accepted you can run the utility to execute the application in a remote machine.

C:\PsExec64.exe \\pc-01 c:\notification\restart-services.bat

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.