Page 1 of 1

Use FileExist() to find file on user's desktop

Posted: 08 Jul 2020, 13:55
by Xtendera
Hello, so I am using FileExist() with InStr() to see if a folder exists on the user's desktop. But the problem is that I don't know how to use variables with the FileExist function (In this case "%A_Desktop%"). I have tried the code below:

Code: Select all

if InStr(FileExist(%A_Desktop%"\myFolder"), "D")
but that gives me an error. I also tried the same thing without the slash before "myFolder" but that doesn't work either. Putting the variable name inside the quotes always reroutes to false. Can someone help me? Thank you.

Re: Use FileExist() to find file on user's desktop  Topic is solved

Posted: 08 Jul 2020, 13:58
by flyingDman
if InStr(FileExist(A_Desktop "\myFolder"), "D")

Re: Use FileExist() to find file on user's desktop

Posted: 08 Jul 2020, 13:58
by boiler

Code: Select all

if InStr(FileExist(A_Desktop "\myFolder"), "D")
Edit: Too slow