Sign in to follow this  
Followers 0
kalewis

Fileexists Question

6 posts in this topic

I am using FileExists to see if a particular directory exists. I want to use wildcards and the function doesnt seem to support wildcards.

What I am doing is seeing if DotNet framework is installed on the computer by searching FileExists(EnvGet("WINDIR") & "\Microsoft.Net\Framework\v2.0*") The wildcard gets ignored. I dont want to hard code this as if the version changes with a service pack or something it will keep re-installing itself.

Any ideas or other ways around this?

Thanks,

Keith Lewis

Share this post


Link to post
Share on other sites



Hi,

don't you think it could be easier to check the registry?

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

I dont know of any registry key that is consistant with what version of framework is installed. Even if there was you would still be stuck on the wildcard. I dont see anything that lets you search a specified registry key with a wildcard.

Thanks

KAL

Share this post


Link to post
Share on other sites

I dont know of any registry key that is consistant with what version of framework is installed. Even if there was you would still be stuck on the wildcard. I dont see anything that lets you search a specified registry key with a wildcard.

Thanks

KAL

Use FileFindFirst()/FileFindNext(), that allows wildcards and check for Directories....

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thank you for this. FileFindFirst worked like a charm. I looked at this but didnt see any mention about directories.

KAL

Use FileFindFirst()/FileFindNext(), that allows wildcards and check for Directories....

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Thank you for this. FileFindFirst worked like a charm. I looked at this but didnt see any mention about directories.

KAL

Often make mistake :)

Just test if its a directory by something like:

If StringInStr(FileGetAttrib($Whole-Path-to-File), "D") > 0 Then
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0