Jump to content

Problem with FileExist


Recommended Posts

CODE
Dim $ImportDup = 0

While $ImportDup <> 6

$szFName = "C:\TEST"

$ImportFile = InputBox("Save As","Enter Filename to Save The New File:",$szFName & "_Importable.csv")

MsgBox(4,"",$ImportFile)

;ClipPut($Importfile)

;Exit

MsgBox(4,"",FileExists($ImportFile))

If FileExists($ImportFile) = 1 Then $ImportDup = MsgBox(4,"File Save Error!", "Target File Already Exists!" & @CRLF & @CRLF & "Do You Want To Save Over This File?")

If $ImportDup = 6 Then FileDelete($ImportFile)

WEnd

C:\TEST_Importable.csv exists, yet the value returned in:

MsgBox(4,"",FileExists($ImportFile))

is ALWAYS 0

What is it that I am doing wrong??

I am even verifying what it's looking for with a temp msgbox, and it does exist, and there is no other params to enter for the FileExist command, so.... HELP!!!!

Link to comment
Share on other sites

yep, here is a copy/paste from a txt file of what it is lookiong for: (Accomplished with a temp ClipPut() command, then pasted)

X:\John Moore\AutoIt Programming\DevelopeThis!\TEST 123006_Importable.csv

NEVERMIND! Blatent act of STUPIDITY!!

I never told my loop what to do in case of NotExist...DUH!

Link to comment
Share on other sites

Straight copy your code works fine for me. I do believe you are really missing that file.

Go to DOS Prompt and do DIR "X:\John Moore\AutoIt Programming\DevelopeThis!\*.*" and see that file is really there.

Sometimes it is different what you see in Windows Explorer.

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...