No announcement yet.

Batch Files To Check the Existing File

  • Filter
  • Time
  • Show
Clear All
new posts

  • Batch Files To Check the Existing File

    The program should be:
    1. List all file and subdirectories including hidden files in Floppy Disk
    2. Delete all text files in floppy befre clear screen
    3. Next check whether the existence of any text files, if exist the text files will copy to floppy disk and display 'all files copied', if no exist change color of screen background and foreground to red or blue befre message 'No files Copied'

    The code i ve done:

    @echo off
    REM Print the welcome message
    echo Hello, Welcome to MS-DOS batch file For question 2aii

    REM pause the screen

    REM clear the screen

    REM notify to list the current folder list
    echo Listing all text files in current directory...

    REM Listing the content of the current directory
    dir *.txt/a/ogn

    REM Delete all the text file
    del *.txt

    REM To check if txt file exit or not

    if exist *.txt del *.txt
    if exist *.txt copy c:\FailGuna


    But i never got the exact program want. Maybe i new in batch file code. But still find solution to do it.. Can anyone or expert help me?

  • #2
    Re: Batch Files To Check the Existing File

    from my limited batching skills where do you change to the floppy drive about??

    try adding a cd a: to your script.