![](/img/trans.png)
[英]How to run a python file (.py) from the windows command-line without having to type python first?
[英]How to run an exe file from windows command line without the title bar?
我有一個外部.exe
文件,需要在我的PC上運行以進行演示。 我運行.exe
(從CMD)命令行文件,當我運行.exe
文件時,它在標題欄為普通窗口的WinForms窗口打開。
我需要能夠以下列限制運行該.exe
文件:
我考慮過嘗試將其包裝到我自己的winform中並從那里運行,但是我猜想可能是在運行.exe
文件時可以將某些參數傳遞給命令行。
在那兒?
Win32 API SetWindowLong
( https://msdn.microsoft.com/zh-cn/library/windows/desktop/ms633591 ( v= SetWindowLong
) SetWindowLong
)支持更改窗口樣式。
命令提示符僅允許通過傳遞--title標志來更改正在運行的應用程序的標題。
但是,您可以嘗試使用有權訪問Win32 API的Powershell腳本。 查看此示例以了解起點。 https://gist.github.com/grenade/ed8dd77ae8eeb5b4a3c1cfd66e9c8ae7
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.