views:

18

answers:

1

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.

A: 

It appears I am doing something wrong with my variables and paths:

<echo message="exists!" if="${directory::exists('\\${server}\share')}"/>

does not work, however:

<property name="test" value="\\${server}\share" />
<echo message="exists!" if="${directory::exists(test)}"/>

works fine!

Shevek