Trying to check for the existance of a file using a logon batch file

Posted on 2009-04-26
Last Modified: 2012-05-06
Hello, this is the command I am trying to get to work:

FOR %%A IN ("\\WIN2008-V2K\deploy\v2k_Test\v2k*.txt") DO IF NOT EXIST "C:\Visual 2000\v2k_Test\%%~xnA" goto TEST

It is checking the location for "v2k*.txt" instead of checking for any txt files in that directory. Can anyone help me write this correctly?

FOR %%A IN ("\\WIN2008-V2K\deploy\v2k_Test\v2k*.txt") DO IF NOT EXIST "C:\Visual 2000\v2k_Test\%%~xnA" goto TEST


Open in new window

Question by:Jon DeVito
    1 Comment
    LVL 3

    Accepted Solution

    I figured it out on my own, please close this question.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    This article was inspired by a question here at Experts Exchange ( The requirements stated in that question are (1) reduce the file size of a large number of…
    Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now