2013-04-10 76 views
3

我已经编写了一个简单的powershell脚本来启动一个winform(在powershell脚本中编写的Winform代码,例如showContent.ps1文件)&显示了一些内容。 我需要在启动Winform后隐藏powershell.exe命令提示符。在Winform启动后隐藏或最小化PowerShell提示

搜索网络中的某些情况下,我尝试了以下方案: 1)我试图执行“powershell.exe -Command -windowstyle隐藏”在脚本文件的开头“showContent.ps1”

2)创建一个新的脚本文件EXA:LaunchWinForm.ps1和所提到的命令: PowerShell.exe -windowstyle隐藏showContent.ps1

这是行不通的。

我使用PowerShell 3.0

谁能告诉了什么错误或提出任何办法做到这一点。

回答

4

试试这个方法:

powershell.exe -WindowStyle Hidden -File c:\showContent.ps1 
+0

它的工作完美的我...谢谢 – usr021986 2013-04-10 11:04:34