Sign in to follow this  
Followers 0
ThaSatelliteGuy

Problem with FileExist

5 posts in this topic

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

Share this post


Link to post
Share on other sites



Are you entering full path in InputBox? Like C:\TEST_Importable.csv

Share this post


Link to post
Share on other sites

Are you entering full path in InputBox? Like C:\TEST_Importable.csv

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

Share this post


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

Share this post


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

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