Skip to content

Instantly share code, notes, and snippets.

@ethaizone
Last active June 11, 2018 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethaizone/c256c1e9498f4771e81cac753fd0944a to your computer and use it in GitHub Desktop.
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.
#!/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
@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" %*
)
@ethaizone
Copy link
Author

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.

  • Create directory and put these files.
  • Add directory to "PATH" at environment variable.

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.

@ethaizone
Copy link
Author

2017-07-22_13-19-21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment