我目前正试图拉一个powershell
脚本驻留在项目子文件夹中。当我的batch
文件运行时,它会尝试在项目中查找文件路径,但我没有取得任何成功。团队城市和批处理文件
我第一次尝试通过子文件夹直接,因为它是在TeamCity的:
set file = "subFolder\myPowershell.ps1"
我我试图第二次尝试拨打:
set file = %~dp0"subFolder\myPowershell.ps1"
然后我尝试:
set file = %cd%"subFolder\myPowershell.ps1"
仍然没有成功。如何从batch
文件中获得Teamcity
项目文件夹中此powershell
脚本的路径?
'%〜dp0“subFolder \ myPowershell.ps1”'对我来说引号没有正确定位。你试过'“%〜dp0subFolder \ myPowershell.ps1”'? – Laf
'set“file =%〜dp0subFolder \ myPowershell.ps1”'将纯路径导入变量'file'而没有周围的引号...... – aschipfl
@Laf是的,我试图在引用中包含'%〜dp0'。 –