1

I want to run a power shell script which can run a exe file and following are my requirements. I have that exe file in a remote server location(//ES-WEBSRV01/DBMigration) which is shared to my local machine. Also I want to run that ps file through a cmd.exe.

1 Answer 1

9

You can simply call it like any other program:

\\ES-WEBSRV01\DBMigration\something.exe

or, if it contains spaces somewhere along the path:

& "\\ES-WEBSRV01\DBMigration\some thing.exe"

I have no clue what you mean by »Also I want to run that ps file through a cmd.exe.«, though. If you mean that you need a batch file and want to run the PowerShell script from there, then:

powershell -file myscript.ps1
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.