Let's start with, you're not checking for a folder you're testing an IP address which is similar to testing for a computer name. There needs to be a resource on the computer that you test for if you expect to test for the existence of a directory. Next, even if the resource can be seen by a user, that doesn't mean they have permissions set up to be able to read or write to the resource. A user that has no permissions of any kind for a particular resource will still be able to test for the existence of the resource if they know the name. If there is a file or folder within the resource and the use has no permissions to use the resource, the file or folder will not exist for them. They will not be able to see it.
That said: I have no computers or other devices with an IP address "192.168.1.0"", yet if I run your script I get a positive result. The message tells me I can access the server. So there is something amiss with the IfDirExists> function.
A little more testing shows that IfDirExists> will give a positive result for "\\" plus any text. For example, this script will test positive
Code: Select all
IfDirExists>\\nonexistentcomputername
MessageModal>I can access this server
EndIf
Add a nonexistent folder and the test will fail:
Code: Select all
IfDirExists>\\nonexistentcomputername\Resource1
MessageModal>I can access this server
EndIf
I would recommend you test a little deeper into the server. Something like:
Code: Select all
IfDirExists>\\192.168.1.0\MyResource\MyFolder
MessageModal>I can access this server
EndIf
Or better yet, if everyone who has permissions to "see" the folder also has permissions to read/write, maybe use writeln> to write to and create a temporary file, check the WriteLn> result variable be be sure it is 0 (zero) and if it is 0 then the user has rights to the folder. Then delete the temp file.