Nant - 检查远程共享是否已存在
我们正在使用 Nant 部署应用程序,需要确保在此过程中创建共享。
我们使用 psexec 和 net share 来创建共享,但是如果共享已经存在,这会失败并停止 Nant。
有什么方法可以检测到共享已经存在吗?
在尝试创建共享之前,或者能够检测到 2
的返回代码或来自 psexec
的 The name has not been Share
消息?
我尝试过 directory::exists
但这总是返回 false。
我尝试将文件复制到远程目录和 file::exists
但这总是返回 false。
We are using Nant to deploy an application and need to ensure that a share is created during the process.
We use psexec
and net share
to create the share but this fails and stops Nant if the share already exists.
Is there any way to detect that a share exists already?
Either before trying to create the share or being able to detect the return code of 2
or the The name has already been shared
message from psexec
?
I have tried directory::exists
but this always returns false.
I have tried copying a file to the remote dir and file::exists
but this always returns false.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来我的变量和路径出了问题:
不起作用,但是:
工作正常!
It appears I am doing something wrong with my variables and paths:
does not work, however:
works fine!