Jump to content

Recommended Posts

Posted

In windows explorer, many files and folders may be under the same folder, and with controllistview method, we can get many things of these files and folders. But How to differentiate a file and a folder? Does autoit provide some methods?

thank you!

Posted

@all

Using this :

$objFSO = ObjCreate("Scripting.FileSystemObject")
$objFolder = $objFSO.GetFolder("C:\Windows\System32")

Consolewrite ( "Type " & $objFolder.Type & @CRLF )

If it returns a Type it is a Folder otherwise it is a File.

regards

ptrex

Posted

how about this trick:

you have a folder c:\temp

in it you have files. you can use fileexists() to determine if a file exists

you always have the NUL File in every folder,

meaning that if you would want to verify if a folder exists, you can check for this file:

if fileexists("c:\temp\NUL") then ..

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...