Creating batch file

Closed
shuchi - Jun 4, 2009 at 02:25 AM
 Mwanasoft - Sep 22, 2009 at 03:15 AM
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.
Related:

4 responses

timeman76 Posts 10 Registration date Tuesday March 17, 2009 Status Member Last seen June 18, 2009 7
Jun 4, 2009 at 03:39 AM
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.
0
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..
0
do you own homework, don't be lazy.
0
NoNam3 Posts 2 Registration date Saturday July 25, 2009 Status Member Last seen July 26, 2009
Jul 26, 2009 at 06:32 AM
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 .
0
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!!!
0