Jump to content

FileExists


Recommended Posts

any ideas anyone......

I want to look for a specific file using @windowsdir. I know the file exists (test conditions) but if I use the following it reorts that the file does not exist

If FileExists(@windowsdir & "filename") then

MsgBox(4096, "exists", "file Exists")

Else

MsgBox(4096, "no exist", "file does NOT exist")

EndIf

however it works fine if I path it directly ie

If FileExists("C:\windows\filename") then

I really cant see whats wrong here, probably my inexperience (read stupidity)

[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

Link to comment
Share on other sites

any ideas anyone......

I want to look for a specific file using @windowsdir. I know the file exists (test conditions) but if I use the following it reorts that the file does not exist

If FileExists(@windowsdir & "\filename") then

MsgBox(4096, "exists", "file Exists")

Else

MsgBox(4096, "no exist", "file does NOT exist")

EndIf

however it works fine if I path it directly ie

If FileExists("C:\windows\filename") then

I really cant see whats wrong here, probably my inexperience (read stupidity)

Edit: Add the backslash as shown, and the quote too.

Edited by MHz
Link to comment
Share on other sites

its just sooooooo easy when you know........

Thanks MHz...once again you save my hair from being torn out

[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

Link to comment
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
 Share

  • Recently Browsing   0 members

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