Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed PHP and PHPUnit in my PC. Both of these files are in same directory and I have added to enviroment variable path. I have also associate .phar extension to run with php.exe application. Now, when I run phpunit.phar in powershell, it is opened in a new window rather the current one. How can I make this run in the same window everytime.

Note: When I do the same thing in cmd.exe, it is opened in same window which is surprising

share|improve this question

Here is a dirty solution I discovered using batch files.

Create a file named phpunit.bat in any of the directory in path environment variables. You can choose windows directory if unsure.

Add the following code to the batch file

@echo off
"c:\path\to\php\php.exe" "C:\path\to\phpunit.phar" %*
share|improve this answer

You must log in to answer this question.