Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 使用.bat启动powershell脚本_Batch File_Powershell 3.0 - Fatal编程技术网

Batch file 使用.bat启动powershell脚本

Batch file 使用.bat启动powershell脚本,batch-file,powershell-3.0,Batch File,Powershell 3.0,我可以在powershell中成功执行以下脚本,但当我尝试从.bat运行脚本时,我失败了。是否存在某种方式,.bat文件在不断失败时调用powershell脚本。 如何创建.bat脚本来运行下面的powershell脚本 cd 'Program Files (x86)\Citrix \XenApp \ServerConfig' .\XenAppConfigConsole.exe /ExecutionMode:Join /FarmName:xencity /OdbcUsername:chris /

我可以在powershell中成功执行以下脚本,但当我尝试从.bat运行脚本时,我失败了。是否存在某种方式,.bat文件在不断失败时调用powershell脚本。 如何创建.bat脚本来运行下面的powershell脚本

cd 'Program Files (x86)\Citrix \XenApp \ServerConfig' .\XenAppConfigConsole.exe /ExecutionMode:Join /FarmName:xencity /OdbcUsername:chris /odbcPassword:Jahner0 /DsnFile:"C:\xencitylifeSQLDS.dsn"
请帮帮我
非常感谢

您可以通过将
powershell
放在命令开头来完成此操作

powershell cd'程序文件(x86)\Citrix\XenApp\ServerConfig.\XenAppConfigConsole.exe/ExecutionMode:Join/FarmName:xencity/OdbcUsername:chris/odbcPassword:Jahner0/DsnFile:“C:\xencitylifeSQLDS.dsn”

这只需调用powershell并向其提供运行命令,除了在cmd中运行它