Skip to content
⌘ NSIS Forum Archive

CreateDirectory sets error but still creates dir

6 posts

samiz#

CreateDirectory sets error but still creates dir

Hi,

I am creating a dir on network share and it raises error flag but also creates the directory.
-----------
ClearErrors
StrCpy $1 "\\nibs.elegent.net\uscda-dfs\LABDATA\LABS\CPCDE-PSFU\Rocks\2015\SharedFiles\TestDir"
CreateDirectory "$1"

IfErrors DIRERROR+1

-----

The above code jumps to DIRERROR label, AND the directory does get created.

Anybody know why is it happening? Is there any special character which is causing to raise flag?

Network is all accessible, and directory gets created without any error thru windows explorer.
samiz#
On some different network environment, CreateDirectory fails to create directory and raises error flag, when thru windows explorer, one can create folder.
Anders#
NSIS basically does:
error = CreateDirectory(path, NULL) ? ERROR_SUCCESS : GetLastError();
if (error != ERROR_SUCCESS) exec_error++;
so I don't really understand what the issue might be.

Does it only happen on network drives? Is it a Samba host?

What does Process Monitor say?

How can I reproduce this?
ahmett#
StrCpy $1 "\\nibs.elegent.net\uscda-dfs\LABDATA\LABS\CPCDE-PSFU\Rocks\2015\SharedFiles\TestDir"
IfFileExists "$1\*.*" +4
CreateDirectory "$1"
IfFileExists "$1\*.*" +2
Goto DIRERROR
Anders#
I did not mean the NSIS code, I'm talking about Windows versions. What is nibs.elegent.net\uscda-dfs? I'm assuming it's a DFS share? But is it Windows server or Samba?

Anyway, there is not much we can do about this since we just call the Windows API normally. But knowing what Process Monitor says would be helpful.