Page 1 of 1

Create Share question

Posted: Tue Mar 19, 2013 11:47 am
by jvinton
I'd like some help understanding the correct way to use Create Share.

If I give it a variable, such as $TARGETDIR$, it works as expected.

If I give it a string for a non-existent folder, such as "c:\xxx\xxx", it seems to run but nothing happens. No error, the folder isn't created, etc,

How is this supposed to work? How do I trap an error? I need to be able to tell the user that "a share has been created..." or "an error occurred creating a share..."

Is it better to call my own DLL that wraps NetShareAdd() and can return an error code?

Re: Create Share question

Posted: Tue Mar 19, 2013 12:52 pm
by FrancescoT
Dear User,

Unfortunately, the "Create Share" command doesn't return a result value.

As possible alternative, you can try to verify if that particular folder exist using "Does File/Folder Exist" and then if TRUE, you could use "Create Share" command.

Regards

Re: Create Share question

Posted: Tue Mar 19, 2013 1:13 pm
by jvinton
FrancescoT wrote:Unfortunately...


Thanks Francesco. I'll make a workaround now that I know how IA handles this.

On one side, I think "IA should be smart enough to return a value from this type of call." But on the other side, I like the way IA works. It requires some extra effort but I prefer software that doesn't try to do everything for everyone.