Help with batch file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
mattman5791
Posts: 4
Joined: 15 Apr 2011 12:01

Help with batch file

#1 Post by mattman5791 » 15 Apr 2011 12:04

Hey guys I need help creating a batch file or at least getting started. Here's what I have to do.

1.ask the user for the name of a directory using user defined variables.
2.Ask the user for text to insert into a file using user defined variables.
3. Get a list of all.txt files located in the c:\\ drive and save it to a file called text.list.txt using bare format. Use user and system variables. .

Any help would be very much appreciated.

THANKS!!!!

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Help with batch file

#2 Post by aGerman » 15 Apr 2011 12:51

Please increase your verbose level :wink:

mattman5791 wrote:1.ask the user for the name of a directory using user defined variables.

Generally, using SET /P.

Code: Select all

set /p "folder=Enter the directory name: "

But what kind of "user defined variables" should be used?


mattman5791 wrote:2.Ask the user for text to insert into a file using user defined variables.

Only one line? In this case you could use SET /P as well. You can write the content of the variable to a file by echo-redirection.


mattman5791 wrote:3. Get a list of all.txt files located in the c:\\ drive and save it to a file called text.list.txt using bare format. Use user and system variables. .

A list of .txt files in the c: root or in the entire c: volume? What means "bare format" and which user and system variables do you want to use and why?


Regards
aGerman

Post Reply