Question

copelandtml

Baseband Member
Messages
45
At the command prompt, enter a Single Command that will rename the file ALPHABET.TXT in the C:\MYFILES directory to ABC.TXT--------------how would i go about doing that?
 
move alphabet.txt c:\myfiles\abc.txt

put that in a batch file and call it abcmove.bat
 
Thanks a lot, would you mind explaining how to perform a few other tasks inside the command prompt. New to programming, if you don't have the time i'll just keep playing around.

1------At the command prompt, enter a Single Command that will MARK the file HIDEME.TXT as a HIDDEN, and READONLY file. (The file is in the C:\MYFILES directory)

2------At the command prompt, enter a Single Command that will move the files FILE1.TXT, FILE2.TXT and FILE3.TXT from the C:\MYFILES directory to the C:\MYFILES\DATA directory. NOTE: You may use * wildcard in this command.

3------At the command prompt, enter a Single Command that will move the files FILE1.TXT, FILE2.TXT and FILE3.TXT from the C:\MYFILES directory to the C:\MYFILES\DATA directory. NOTE: You may use * wildcard in this command.

4------At the command prompt, enter a Single Command that will satisfy all of the following criteria:
Copy the contents of the C:\MYFILES directory into a directory called C:\BACKUP\MYFILES
Include all the subdirectories, including the empty ones
Copies all files, including hidden and system files
Display the source and destination filenames while copying
 
it really depends what you want to do in the command prompt.

there is a ton of stuff that you *can* do, but it's all pretty useless if you have no application for doing those things.

basically, you're just running programs from the command line, that could either start a graphical interface, or it could send back a line or a screen of text.

for example, you type dir and a list of the files in the current directory comes back.

type copy (file) (destination) and you copy a file that you specify to a destination
type move (file) (destination and you move a file

type tasklist and you get a list of running processes.


what other tasks do you have in mind?
 
Yeah, I've been learning some of the commands in the prompt, prof kinda jumped a few steps. I'm just playing around trying to figure stuff out, the code needs to be perfect to run, gets a little frustrating. The following are the other tasks I'm trying to figure out.

1------At the command prompt, enter a Single Command that will MARK the file HIDEME.TXT as a HIDDEN, and READONLY file. (The file is in the C:\MYFILES directory)

2------At the command prompt, enter a Single Command that will move the files FILE1.TXT, FILE2.TXT and FILE3.TXT from the C:\MYFILES directory to the C:\MYFILES\DATA directory. NOTE: You may use * wildcard in this command.

3------At the command prompt, enter a Single Command that will move the files FILE1.TXT, FILE2.TXT and FILE3.TXT from the C:\MYFILES directory to the C:\MYFILES\DATA directory. NOTE: You may use * wildcard in this command.

4------At the command prompt, enter a Single Command that will satisfy all of the following criteria:
Copy the contents of the C:\MYFILES directory into a directory called C:\BACKUP\MYFILES
Include all the subdirectories, including the empty ones
Copies all files, including hidden and system files
Display the source and destination filenames while copying
 
For 1), have a look at the attrib command. The others you should be able to find pretty easily with a bit of research.
 
yes, the attrib command, attrib -a to set the archive bit.
attrib -h to hide
attrib -r to set to read only.

if your at a directory (c:\myfiles) you could type move c:\myfiles* c:\yourfiles and it'll move everything.

you could use the * wild card but that's a broad wildcard .

say you have files
file1.txt
file2.txt
file3.txt
file1.bmp
file1-copy.txt
readme.txt

if you type copy * it'll copy all the text files
if you type copy *.txt it'll copy all the text files
if you type copy file*.txt file it'll copy all the files that are text files where the file name starts text. (file1.txt, file2.txt, file3.txt file1-copy.txt)

if you type copy file?.txt it'll copy all the text files that are text where the file name starts with file, then has one charecter then a dot and txt (file1.txt, file2.txt, file3.txt)

you could use copy file[0-9].txt and it'll copy all files where the name starts file, then has a character in the range 0 - 9 and has a .txt file extension.


for the last one. check out xcopy...

at the command line type xcopy /? and you;ll see all the options.
 
Back
Top Bottom