Computer Hope

Microsoft => Microsoft DOS => Topic started by: myusri on March 12, 2009, 04:56:51 AM

Title: Batch File Need Help
Post by: myusri on March 12, 2009, 04:56:51 AM
I have create this batch file:

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

REM pause the screen
pause

REM clear the screen
cls

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 patuh.txt del patuh.txt

pause


Actually I want this progam to:
-Display all file and subdirectories including hidden files in the floopy disk
-Then the program will delete all text files in floppy disk before clear the screen
-After that prog will check whether the any text files exist or not in current directory, if exist all the text files copy to floopy disk, else change the colour of  the screen background and foreground to red or yellow

Quit tricky but i m still  no idea to continue the prog. Anyone can help plz?
Title: Re: Batch File Need Help
Post by: Dias de verano on March 12, 2009, 05:17:42 AM
homework?
Title: Re: Batch File Need Help
Post by: myusri on March 12, 2009, 05:26:38 AM
a quiz from my friend to beat me. Well i new here
But im still keep  to find solution here
Anyone can help me?
Title: Re: Batch File Need Help
Post by: Dias de verano on March 12, 2009, 05:33:33 AM
type DIR /? to find out all you need to know.

Title: Re: Batch File Need Help
Post by: myusri on March 12, 2009, 06:04:08 AM
type DIR /? to find out all you need to know.

command dir/? is to list all files and subdirectories icluding hidden files?? Is it?
Title: Re: Batch File Need Help
Post by: macdad- on March 12, 2009, 06:10:24 AM
he means find out yourself, no homeworking helping...

DIR /?
lists all the switches and parameters for DIR.
Title: Re: Batch File Need Help
Post by: myusri on March 12, 2009, 06:28:29 AM
this is forum ... so i'm please to get the info or clue from all of you here. Dont get me wrong. But im still hope to find the solution from the expert outhere. Can expert help me?
Title: Re: Batch File Need Help
Post by: Dias de verano on March 12, 2009, 06:32:13 AM
this is forum ... so i'm please to get the info or clue from all of you here. Dont get me wrong. But im still hope to find the solution from the expert outhere. Can expert help me?

Expert already did. Read the posts.
Title: Re: Batch File Need Help
Post by: Carbon Dudeoxide on March 12, 2009, 07:59:13 AM
Have you gone to Command Prompt and typed 'dir /?' yet?
Title: Re: Batch File Need Help
Post by: myusri on March 12, 2009, 10:02:56 PM
yup i already done dir /?

Title: Re: Batch File Need Help
Post by: Dias de verano on March 13, 2009, 01:16:48 AM
yup i already done dir /?



And what did you learn?