Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Testing for a text file 1

Status
Not open for further replies.
Aug 9, 2001
23
0
0
GB
In one piece of code I have output a text file to the root of the C:\ drive.

Later on I want to knowwhether that txt file is there. Apart from opening it is there a way I can test to see if it is there?

Any help, greatly appreciated,

Thom.
 
Hi Thom,

you can use - if Dir(&quot;C:/PathToTextFileAndName.txt&quot;)=&quot;&quot; then doesn't exist, or if Dir(&quot;C:/PathToTextFileAndName.txt&quot;)<>&quot;&quot; then does exist

HTH

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top