Creating batch file

[Closed]
Report
-
 Mwanasoft -
Hello,

i want to know

how to create batch file that do the following:
(a).show system date and time,
(b).change the prompt to your name,
(c).show the contents of the subdirectory.

4 replies

Posts
10
Registration date
Tuesday March 17, 2009
Status
Member
Last seen
June 18, 2009
7
First you should try to create your batch file, using notepad. The steps are describe in this tiphttp://ccm.net/faq/sujet 1051 batch file.

Once the file is created, you can then implement the necessary features allowing it to display :

System date and time, show the contents of the subdirectory and change the prompt to your name.

For this part i'll recommend you to check out Microsoft website to have the necessary information.
i asked u a question about creating a batch file for

System date and time, show the contents of the subdirectory and change the prompt to your name.

plz give me proper syntax...i dnt know how to sove these problems..
do you own homework, don't be lazy.
Posts
2
Registration date
Saturday July 25, 2009
Status
Member
Last seen
July 26, 2009

Hello,

i want to know

how to create batch file that do the following:
(a).show system date and time,
(b).change the prompt to your name,
(c).show the contents of the subdirectory.

Configuration: Windows XP Internet Explorer 6.0

ok solution...

A) show date and time

copy this into notepad and rename it as xxx.bat

*********************<Do Not Include This Star>****************

@echo off
echo Date:%date%
echo Time:%time%
pause

*********************<Do Not Include This Star>****************

after u run the bat file you will see date and time inside cmd box.

or
u may want to make it as msg box, here the syntax.. same way copy and paste to notepad and rename it
to xxx.bat


*********************<Do Not Include This Star>****************

@echo off
msg * Date: %date% Time:%time%
exit

*********************<Do Not Include This Star>****************
after u run it,the msg box will appear and tells you about date and time.but not the cmd.


****************************************************************

B) change the prompt to your name,

sorry really don't understand what u mean by that. Pls be more specified .


****************************************************************

C) show the contents of the subdirectory.

sorry really don't understand what u mean by that. Pls be more specified .
Answer to the below questions is as follows according to me

Hello,

i want to know

how to create batch file that do the following:
(a).show system date and time,
(b).change the prompt to your name,
(c).show the contents of the subdirectory.

Hope you know how to create a .bat file so have the following commands in your .bat file

1. @echo off

2. echo Date:%date%
3. echo Time:%time%

4. prompt Mwanasoft

5. dir

Please don't number the commands as i have done.
Just a little explanation of the lines (Commands)

Line1. will turns command-echoing off.
Line2. Will display the current date
Line3. Will display the current time
Line 4. Will change the prompt name to 'Mwanasoft' you can replace that with your name.
Line 5. Will displays a list of files and subdirectories in a directory.

Have a nice day and enjoy!!!