enter image description hereEx.
$ap = Get-location "cd c:\osit\bin\acf"
$ap ./acf -t然而,它不起作用。错误是它不是一个命令小程序。
因为acf -t只能在该目录上运行,所以我需要创建一个脚本,它将自动调用该目录并运行该acf -t
请帮帮忙。谢谢。
发布于 2018-08-27 02:41:13
去掉Get-Location部件,cd本身就能正常工作:
cd c:\osit\bin\acf
.\acf.cmd -t发布于 2018-08-27 14:24:22
试试这个(评论以#开头;没有代码就是“代码”)
# save the current path to variable $path
$path = Get-Location
# change path to executable
Set-Location -Path 'c:\osit\bin\acf'
# execute programme
.\act.cmd -t
# change back to the path we came from
Set-Location -Path $pathhttps://stackoverflow.com/questions/52029194
复制相似问题