试试cygwin的 run.exe 命令。这是一个大安装,一个完整的 Windows 机器的 unix 环境。假设您将它安装在c:\cygwin\
.
没有什么神秘的,只要运行c:\cygwin\bin\run.exe <your command here>
,你就会有你的 no dos 窗口执行。
您可以从任何 DOS 窗口运行它(从开始菜单运行 cmd.exe)。您不需要从 cygwin 运行它。
为了使它更容易,请附加C:\cygwin\bin
到您的 %PATH% 环境变量(我的电脑 → 属性 → 高级 → 环境变量)(感谢 Felipe Alvarez 评论)。
现在你可以输入
c:\cygwin\bin\run.exe "C:\foo.bsh"
您必须使用此命令在开始菜单中创建一个链接,以便能够使用 Win-R 运行它。
这是 run 命令的手册页:
$ man run
RUN(1) run 1.3.0 RUN(1)
NAME
run - start programs with hidden console window
SYNOPSIS
run [ -p path ] command [ -wait ] arguments
runcommand [ -p path ] [ -wait ] arguments
DESCRIPTION
Windows programs are either GUI programs or console programs. When
started console programs will either attach to an existing console
or create a new one. GUI programs can never attach to an exiting con‐
sole. There is no way to attach to an existing console but hide it if
started as GUI program.
run will do this for you. It works as intermediate and starts a pro‐
gram but makes the console window hidden.
With -p path you can add path to the PATH environment variable.
Issuing -wait as first program argument will make run wait for program
completition, otherwise it returns immediately.
The second variant is for creating wrappers. If the executable is
named runcommand (eg runemacs), run will try to start the program (eg
emacs).
EXAMPLES
run -p /usr/X11R6/bin xterm
run emacs -wait
runemacs -wait
run make -wait
AUTHORS
Charles S. Wilson
Harold L Hunt II
Jehan Bing
Alexander Gottwald
Version 1.3.0 November 2005 RUN(1)