Sign in to follow this  
Followers 0
shornw

FileExists

3 posts in this topic

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]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
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]

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