Last active
June 11, 2018 08:27
-
-
Save ethaizone/c256c1e9498f4771e81cac753fd0944a to your computer and use it in GitHub Desktop.
[Windows] Make any GUI program and run from CLI. This example is PHPStorm.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
basedir=`dirname "$0"` | |
# This is like symlink for bash cmd such as mintty, GIT bash, Cygwin | |
# I pass parameters to it too. | |
"$basedir/pstorm.cmd" "$@" | |
# Note - I tried create symlink but it not work at bash environment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Automatic is best | |
:: I tested on Windows 10 only. | |
for /f "delims=" %%A in ('dir "C:\Program Files\JetBrains" /s /b ^| findstr /e phpstorm64.exe') do ( | |
start /b "" "%%A" %* | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to?
This files is example for create cmd launcher for PHPStrom for Windows. This one can work for many IDE/Editor that don't have cmd launcher feature. Just edit file name and content to match your program.
I tested on Windows 10, Git bash, Comemu (with Git bash) and Power shell.
Note1: If you use Git bash, after add environment variable you need to restart Windows because Git bash don't update PATH realtime.