troubleshooting Question

Does file exist using replace to change file extension

Avatar of Dale Fye
Dale FyeFlag for United States of America asked on
Windows Batch
13 Comments2 Solutions72 ViewsLast Modified:
I'm trying to determine whether a file exists in a folder and if so exit my batch file.

What I would like to do is pass the batch file a folder and a filename as separate arguments.

The filename will be something like: MyAccessDatabase.accdb

Then, in the batch file, I need to check to see whether there is a file in the folder passed as the 1st argument with a file extension of .laccdb, so I would be looking for the existence of: MyAccessDatabase.laccdb

If that file exists, I would like to display a message on screen for the user: "The application is already open or closed improperly.  If the application is not running, contact Steve"

Then I want it to exit the batch file.  If that file does not already exist, I want it to continue process the rest of the batch file
Join our community to see this answer!
Unlock 2 Answers and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros