Directory.SETFILTER(Path,'C:\'); // Works better than CLEAR :)
IF Directory.findfirst THEN; // Works better than CLEAR :)
Directory.SETFILTER(Path,'C:\temp\');
Directory.SETRANGE("Is a file",false);
MESSAGE('%1',Directory.findfirst);
You can use the automation 'Microsoft Scripting Runtime'.FileSystemObject. Use the function FolderExists. Just pass the path and it will return a boolean value weather the certain folder exists or not.
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thats not quite good enough. If the folder doesn't exist, you will still get an error...
Hello,
I did not get an error using SETFILTER.. Hope this helpes you..
Rvduuren
As far as I understand, your check is if there exists subfolders in the folder c:\temp...? I want to check if c:\temp\ exists...
Hello Jens,
I'm not checking any subfolders with above code, just if c:\temp exists. But you can also use FileSystemObject:
Rvduuren
This won't work. Exists only is used for files not folder.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Doesn't work, it always returns FALSE
RIS Plus, LLC
create a button and put this in the push event:
Run it and if you have a
Yes
Yes
No
Yes
<edit>modified post with updated information</edit>
RIS Plus, LLC
RIS Plus, LLC
Since the exists will run in service tier .net dll.
Learning something new every day.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n