Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
if file exists? (VB)
Name: DAVE Date: June 30, 2003 at 14:18:19 Pacific OS: Windows XP CPU/Ram: AMD Athlon XP 1700+ / 256
Comment:
im trying to make it so if a certain file exists, the program runs another program. ive got the running the other program part, but i have no clue how to make VB check for that first file. can someone give me some code or explain how i would go about doing this?
Name: Zad01 Date: June 30, 2003 at 20:24:32 Pacific
Reply:
if dir$("path\filename"""then ' If File Exists [ie. path\filename = "c:\windows\calc.exe"]
Run Program 1
else ' If File Dose Not Exists
Run Program 2
endif
Hope this Helps
0
Response Number 2
Name: A Certain TH Date: July 2, 2003 at 04:42:12 Pacific
Reply:
The above is the sensible way.
Another way is to jump into a boolean function which tries to open the file directly. Put an error handler on this function. Then the function either returns success or failure and you have the file open and ready to use if it was successful.
Summary: I am implementing an application using ftp to transfer files from ftp server to local location. I want to see if a particular file exists before starting the download for all files. I implement this s...
Summary: Hi, I'm pretty new to batch program, but I've been asked at work to create a batch that renames one file, then renames another file to the name of the first file. Then the next time it runs, I'd like ...
Summary: Hi, I'm trying to write a VBScript that if any file exists in a particular folder it exits and does nothing. If no files exist then it creates a file and writes some text inside of it. I have the cr...