Wrox Programmer Forums
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 8th, 2003, 06:50 PM
Authorized User
 
Join Date: Jun 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Find file with _ in it

Hello all,
I am trying to locate a file with an _ in it.
Here is what I have.

 If (fso.FileExists("C:\WINDOWS\Progs_.ini")) Then
    msgBox "C:\WINDOWS\Progs_.ini exists."
 Else
    msgBox "C:\WINDOWS\Progs_.ini doesn't exist."
 End If

But I get C:\WINDOWS\Progs_.ini doesn't exist.".
I know its there, I put it there but if I remove the _ from the file name and from my code like this,

If (fso.FileExists("C:\WINDOWS\Progs.ini")) Then
    'Kill "C:\WINDOWS\Progs.ini"
    msg = "C:\WINDOWS\Progs.ini exists."
  Else
    msg = "C:\WINDOWS\Progs.ini doesn't exist."
  End If

it works fine. Why?

Help!
 
Old April 23rd, 2004, 05:43 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 231
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It might be because the underscore character is a wildcard character, you may need to escape the underscore.

Regards
Owain Williams





Similar Threads
Thread Thread Starter Forum Replies Last Post
find number of lines in .txt file dgr7 Beginning VB 6 8 July 16th, 2014 05:11 AM
The SSE Provider did not find the database file Tawanda BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 June 16th, 2007 10:31 AM
XslTransform/Could not find file error redeye2 Pro VB.NET 2002/2003 0 October 22nd, 2004 10:01 AM
system don't find vbc.exe file yln BOOK: Beginning ASP.NET 1.0 1 August 2nd, 2004 03:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.