windows - 在 linux 上运行 windows nt 的 cmd 或 bat 文件

标签 windows bash shell cmd

如果我想在 Windows 上运行 bash 脚本,我可以安装 cygwin。 但是,我想在 Linux 上运行 .bat 文件。 linux下有没有这样的shell(cmd.exe的端口:))?

最佳答案

你不想在 linux 上运行 .bat 文件,如果你真的想这样做,你可以在 linux 上使用 WINE。 CMD 语言没有很多编程结构,很少用于做任何复杂的事情,它们非常特定于 Windows,主要用于在 Windows 上启动其他程序。

不过,有一种相对简单的方法可以将 bash 脚本包装在 .bat 中。

@setlocal
@cd C:\cygwin\bin
@start bash --login -i /home/your_id/yourscript
@endlocal

关于windows - 在 linux 上运行 windows nt 的 cmd 或 bat 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10285508/

相关文章:

windows - 使用Rundll32复制SUBST的功能

c++ - C++ 如何将文件发送到浏览器

windows - Windows 上的 gtk2hs 无法运行

linux - 差异继续错误

windows - 如何强制事件跟踪 session 更频繁地刷新数据?

linux - 脚本导致 CPU 使用率高

Linux 按列合并两个文件

python - 为什么 virtualenvwrapper 不能在 wing ide pro 终端内工作?

bash - 计算一列中具有特定符号的行数(来自 grep 的结果)?

bash - 使用 (...) 创建的子 shell 的行为不同于 bash -c '...'