PDA

View Full Version : Command line questions


mikehende
07-06-2006, 06:25 PM
Don't know if this topic belongs here, if not, please move to appropriate forum. Concerning moving through directories, I open the cmd prompt which shows

c:\documents and settings\mike

I change this to

C:\Program Files\Steinberg\WaveLab Lite\Tools\SystemInfo

1] How do I "jump" to and also "view" the wavelab lite directory?

2] Then how do I get back to

C:\Program Files\Steinberg\WaveLab Lite\Tools\SystemInfo

Thanks.

Terry Hanushek
07-06-2006, 11:04 PM
Mike

In Command Prompt, to navigate in a directory tree you can use the CD (change directory) command. A directory is a folder.

There are two forms of the CD command:

1. CD \path1 where path1 is a directory name (or names separated by backslashes). It a reference from the root of the current drive

2. CD path2 where path2 is is a directory name (or names separated by backslashes) in the current directory. It is a reference within the current directory.

The significant difference is is the use of the leading backslash to designate the root.

Question 1 (A) How do I "jump" the wavelab lite directory?

I am not aware of a method to go back from your current position, so it is necessary to go up from the root.

At the C:\Program Files\Steinberg\WaveLab Lite\Tools\Systeminfo prompt, enter cd \program files\steinberg\wavelab lite This will result in the desired path of: C:\Program Files\Steinberg\WaveLab Lite

Question 1 (B) How do I view the wavelab lite directory?

You can use the Directory (Dir) command to view all entries in a folder. Enter dir at the C:\Program Files\Steinberg\WaveLab Lite prompt to list all entries in the WaveLab Lite directory.

Question 2 How do I get back?

At the C:\Program Files\Steinberg\WaveLab Lite prompt, enter cd tools\systeminfo (without the leading backslash) to return to the original directory.

HTH

Terry

kelly
07-07-2006, 04:16 PM
I remember there being a command to go up one level. Just don't remember the command. Maybe enter something like <space> or ^ at the prompt.

-td

Terry Hanushek
07-07-2006, 04:42 PM
Tony

I remember there being a command to go up one level. Just don't remember the command. Maybe enter something like <space> or ^ at the prompt.
It seems like there should be a command like that but it did not jump out at me last night. I'll browse a DOS manual tonight to see if I can come up with something.

Terry

kelly
07-07-2006, 05:02 PM
Try CD.. (that 2 periods)

Also try CD/? or DIR/? for help

PeteF
07-07-2006, 05:09 PM
I remember there being a command to go up one level. Just don't remember the command.

Up one level...

cd..

--pete--

dale@fcg
07-07-2006, 09:39 PM
To go up two levels, use three periods cd...
To go up three levels, use four periods cd....
so on and so forth cd..... cd...... etc

Terry Hanushek
07-07-2006, 10:00 PM
Tony / Pete / Dale

Thanks for the help. Now we are all set if DOS comes back. :)

:first:

Terry

dale@fcg
07-07-2006, 10:29 PM
:help:Our Paltalk buddy Al is convinced that DOS is the only rival to Win98 First Edition. :ballchain:

mikehende
07-11-2006, 12:57 PM
To go up two levels, use three periods cd...
To go up three levels, use four periods cd....
so on and so forth cd..... cd...... etc

Thanks a lot Terry and all the rest of you guys, sorry it took so long from em to get back to this but I got it now except for dale's instructions above, Dale, this does not work on my end, does it work for you and everyone else?

PeteF
07-11-2006, 03:52 PM
Thanks a lot Terry and all the rest of you guys, sorry it took so long from em to get back to this but I got it now except for dale's instructions above, Dale, this does not work on my end, does it work for you and everyone else?

No it does not work on WinXP.
Only this works.... CD..
to go up one level.

---pete---

mikehende
07-11-2006, 04:51 PM
I just found out that the command line chapter in MM's book is mainly referring to win98 so no wonder I am going through hell trying out his stuff in XP:mad: and can't get some of it to work. BTW, Dale and anyone else, in XP this works cd..\.., the more you use the furhter back you can go so if you wish to back up by 3 directories then you type cd..\..\..

mikehende
07-11-2006, 06:02 PM
I am now up to creating/deleting files and deleting files according to the book is totally killing me , anyone here up the challenge?

kelly
07-11-2006, 06:20 PM
What does the book say? Isn't it something like

del C:\Documents and Settings\tdipiano\My Documents\somefile.doc

-td

PeteF
07-11-2006, 07:58 PM
I just found out that the command line chapter in MM's book is mainly referring to win98 so no wonder I am going through hell trying out his stuff in XP:mad: and can't get some of it to work. BTW, Dale and anyone else, in XP this works cd..\.., the more you use the furhter back you can go so if you wish to back up by 3 directories then you type cd..\..\..

Thanks Mike, I never knew about cd..\.. and going up multiple firectories.

The commands changed a bit when WinXP came out, but most are the
same. Below is a list of the commands in WinXP. ---pete---


ASSOC Displays or modifies file extension associations.

AT Schedules commands and programs to run on a computer.

ATTRIB Displays or changes file attributes.

BREAK Sets or clears extended CTRL+C checking.

CACLS Displays or modifies access control lists (ACLs) of files.

CALL Calls one batch program from another.

CD Displays the name of or changes the current directory.

CHCP Displays or sets the active code page number.

CHDIR Displays the name of or changes the current directory.

CHKDSK Checks a disk and displays a status report.

CHKNTFS Displays or modifies the checking of disk at boot time.

CLS Clears the screen.

CMD Starts a new instance of the Windows command interpreter.

COLOR Sets the default console foreground and background colors.

COMP Compares the contents of two files or sets of files.

COMPACT Displays or alters the compression of files on NTFS partitions.

CONVERT Converts FAT volumes to NTFS. You cannot convert the
current drive.

COPY Copies one or more files to another location.

DATE Displays or sets the date.

DEL Deletes one or more files.

DIR Displays a list of files and subdirectories in a directory.

DISKCOMP Compares the contents of two floppy disks.

DISKCOPY Copies the contents of one floppy disk to another.

DOSKEY Edits command lines, recalls Windows commands, and creates macros.

ECHO Displays messages, or turns command echoing on or off.

ENDLOCAL Ends localization of environment changes in a batch file.

ERASE Deletes one or more files.

EXIT Quits the CMD.EXE program (command interpreter).

FC Compares two files or sets of files, and displays the differences
between them.

FIND Searches for a text string in a file or files.

FINDSTR Searches for strings in files.

FOR Runs a specified command for each file in a set of files.

FORMAT Formats a disk for use with Windows.

FTYPE Displays or modifies file types used in file extension associations.

GOTO Directs the Windows command interpreter to a labeled line in a
batch program.

GRAFTABL Enables Windows to display an extended character set in graphics
mode.

HELP Provides Help information for Windows commands.

IF Performs conditional processing in batch programs.

LABEL Creates, changes, or deletes the volume label of a disk.

MD Creates a directory.

MKDIR Creates a directory.

MODE Configures a system device.

MORE Displays output one screen at a time.

MOVE Moves one or more files from one directory to another directory.

PATH Displays or sets a search path for executable files.

PAUSE Suspends processing of a batch file and displays a message.

POPD Restores the previous value of the current directory saved by

PUSHD.

PRINT Prints a text file.

PROMPT Changes the Windows command prompt.

PUSHD Saves the current directory then changes it.

RD Removes a directory.

RECOVER Recovers readable information from a bad or defective disk.

REM Records comments (remarks) in batch files or CONFIG.SYS.

REN Renames a file or files.

RENAME Renames a file or files.

REPLACE Replaces files.

RMDIR Removes a directory.

SET Displays, sets, or removes Windows environment variables.

SETLOCAL Begins localization of environment changes in a batch file.

SHIFT Shifts the position of replaceable parameters in batch files.

SORT Sorts input.

START Starts a separate window to run a specified program or command.

SUBST Associates a path with a drive letter.

TIME Displays or sets the system time.

TITLE Sets the window title for a CMD.EXE session.

TREE Graphically displays the directory structure of a drive or path.

TYPE Displays the contents of a text file.

VER Displays the Windows version.

VERIFY Tells Windows whether to verify that your files are written
correctly to a disk.

VOL Displays a disk volume label and serial number.

XCOPY Copies files and directory trees.

---end---

mikehende
07-11-2006, 08:58 PM
One basic concept still seems to be evading me, can anyone answer this question please? "When and where" does someone know to use a "space" when writing a command?

Terry Hanushek
07-11-2006, 10:20 PM
Mike

I am now up to creating/deleting files and deleting files according to the book is totally killing me , anyone here up the challenge?
The Delete (or Del) command is the basic method to delete a file in Command Prompt. Its syntax is Del [filename] The file needs to be qualified with the appropriate directories to uniquely identify the target file.

Using the directory structure in your original example, to delete a file named test.txt in the systeminfo file you could

1) Use the CD (Change Directory) to point to the systeminfo directory - c:> cd \program files\steinberg\wavelab lite\tools\systeminfo
Then use the delete command to remove the file - c:\program files\steinberg\wavelab lite\tools\systeminfo> del test.txt

2) To delete the file directly from the root, you can use the structure that Tony mentioned above del c:\program files\steinberg\wavelab lite\tools\systeminfo\test.txt

Within the Del command, wildacards can be used to delete a range of files.

del *.txt will delete all text (.txt) files in the current directory.
del quark.* will delete all of the files named 'quark' in the current directory regardless of extension.
del *.* will delete all files in the current directory

Unfortunately, creating files is not as easy. I am not aware of a command used to simply create a file. A program (like Notepad) can be used to create a file with its Save As option. An existing file can be copied to a new file name using the Copy command. Its syntax is Copy [filenamea] [filenameb] where filenamea exists and filenameb is to be created.

HTH

Terry

kelly
07-12-2006, 07:44 AM
Terry - just checking here. Is it legal to use the space key in a file/folder name when working in DOS?

e.g.: wavelab lite

-td

PeteF
07-12-2006, 08:52 AM
Terry - just checking here. Is it legal to use the space key in a file/folder name when working in DOS?

e.g.: wavelab lite

-td

When working with the commmand prompt or DOS batch files
you have to enclose paths & filenames with quotes when there
is a space involved.

Example...
"wave lite"

Example...
dir "C:\Documents and Settings\Owner\My Documents\"


---pete---

mikehende
07-12-2006, 09:27 AM
The reason why I skipped my previous question guys is becuase I think I may be placing the cart before the horse here so let me ask this first and then get back to deleting files issues. "When and where" does someone know to use a "space" when dealing with commands?

Terry Hanushek
07-12-2006, 09:59 AM
Tony

Terry - just checking here. Is it legal to use the space key in a file/folder name when working in DOS?

e.g.: wavelab lite
When I first started to respond to Mike's questions, I was thinking in DOS mode. DOS never supported long file names and everything had to be in the original 8.3 file naming format. The WaveLab Lite folder name would render as Waveli~1 in DOS. When I tested my advice before posting, I found the WinXP supports long file names and embedded spaces. Hence Command Prompt appears to be DOS with a XP accent.

Terry

kelly
07-12-2006, 10:03 AM
Terry - thanks, I didn't know that. I knew DOS didn't support long filenames and they are rendered as you say with ~. But didn't think deep enought when I posted the command with a long filename. If I'd put 2 + 2 together, I would have realized that I was missing something.

thanks again for clearing that up.

-td

mikehende
07-12-2006, 12:11 PM
I have been searching and searching the net since yesterday trying to find a tutorial on the use of spaces in the command line and simply cannot find any, would anyone here happen to know of any?

Terry Hanushek
07-12-2006, 01:35 PM
Mike

Command Prompt and DOS for the most part use space as a delimiter between a command and its argument(s). There are other delimiters like the back slash. DOS, as Tony and I discussed above, did not permit embedded spaces; Command Prompt does.

The specific uses of delimiters is controlled by the syntax of the individual commands. Like HTML multiple spaces act like a single space.

One thing that you can be sure of is that if you omit a required space or add an inappropriate space, the command interpreter will let you know. :)

If you have any questions on a specific command, you can enter Help [command] to get the complete syntax and options.

HTH

Terry

mikehende
07-12-2006, 01:51 PM
Appreciate the explanation but I have been told that not including spaces where they should be will simply result in the command not working so I am having trouble knowing "when" or "where" to use the space in a command, sometimes I see a command line with a few spaces other times, I will see only 1 space, after the command, so how can I know when/where to use the space or spaces? This is what I need to know.

Terry Hanushek
07-12-2006, 02:01 PM
Mike

I am having trouble knowing "when" or "where" to use the space in a command, sometimes I see a command line with a few spaces other times, I will see only 1 space, after the command, so how can I know when/where to use the space or spaces? This is what I need to know.
One space is the same as many as I stated above. DOS commands are not positional.

Terry

mikehende
07-12-2006, 02:26 PM
ok thanks, let's get back to where i'm at now please, Removing Directories, following MM's example, I created a directory named quake3 and tried the RD but it says "directory is not empty" so I try "del files", files being one of the subdirectories I am seeing listed in Quake3 and I get the prompt

c:\quake3\files\*, are you sure [y/n]?

I press Y on the keyboard and hit Enter and then type "dir" to see inside the Quake3 diretory and the file subfolder is still there, what am I doing wrong or what do I have to do to delete the contents [3 directories] of Quake3?

mikehende
07-12-2006, 02:36 PM
Here is a pic, hope it can be seen clearly.
.

Terry Hanushek
07-12-2006, 10:25 PM
Mike

ok thanks, let's get back to where i'm at now please, Removing Directories, following MM's example, I created a directory named quake3 and tried the RD but it says "directory is not empty" so I try "del files", files being one of the subdirectories I am seeing listed in Quake3 and I get the prompt

c:\quake3\files\*, are you sure [y/n]?

I press Y on the keyboard and hit Enter and then type "dir" to see inside the Quake3 directory and the file subfolder is still there, what am I doing wrong or what do I have to do to delete the contents [3 directories] of Quake3?
If you have a directory named Quake3 and a subdirectory named Files which has one or more files in it, you can entirely remove the Files subdirectory with either of the following commands:

c:> rd Quake3\Files /s

or

C:\Quake3> rd Files /s

The /s switch allows you to delete all files and subdirectories in the target directory.

You can get addition information about the Remove Directory command in Command Prompt by entering Help RD

Terry

mikehende
07-13-2006, 03:39 PM
Thanks a million Terry, just finished creating and deleting a few folders, got the hang of it now!

mikehende
07-18-2006, 10:51 AM
Question this time concerns "Attributes", I have a folder named "football files" and in this folder there is a file named "drawplushelp.doc", among others. I am trying to view this file's attributes from the command line so I type

attrib drawplushelp.doc

but nothing happens, help?

Terry Hanushek
07-18-2006, 01:19 PM
Mike

Question this time concerns "Attributes", I have a folder named "football files" and in this folder there is a file named "drawplushelp.doc", among others. I am trying to view this file's attributes from the command line so I type

attrib drawplushelp.doc

but nothing happens, help?
The format of your attrib command appears correct if the current directory is football files. In other words, was your command prompt c:\football files> ?

If it was not, it is necessary for you to provide the drive and path. From the C: prompt (root directory) you could have entered C:>attrib \football files\drawplushelp.doc

The return from a successful attrib command is a string of the file attributes followed by the file name.
Example: A drawplushelp.doc .. indicates that the archive attribute is set for this file.

In Command Prompt, type help attrib to get a complete explanation of the command.

Terry

mikehende
07-18-2006, 01:33 PM
I typed this

C:\>attrib \football files\drawplushelp.doc

and it says

"parameter format not correct"

dbarrow
07-18-2006, 02:34 PM
Looks like you may be missing a /switch.
Go the the MSKB and search out COMMAND LINE functions.
There should be an article there that lists all of them with the breakdown of the switches.

At a command prompt, type attrib /?
that will give you all the switches.

mikehende
07-18-2006, 03:47 PM
still doesn't help me get to view the drawplushelp.doc attributes unfortunately.

PeteF
07-18-2006, 05:55 PM
I typed this

C:\>attrib \football files\drawplushelp.doc

and it says

"parameter format not correct"

Add the quotes and it will work.
Assuming you have a folder.. C:\Football files
Whenever you have a space in the spec of a folder path or
filename, you automaticaly need quotes around that spec.

C:\>attrib "\football files\drawplushelp.doc"

---pete---

mikehende
07-18-2006, 05:58 PM
Mike Meyers is really starting to piss me off:mad: , the Command line section in his book is the worst I've seen, seems to me he himself doesn't understand this but is vainly trying to teach it, I have been stuck on this section for 2 weeks now and only got help here on this forum and from spending hours upon hours on the net searching for and re-reading tutorials, I mean what the Bleepety-bleep-bleep-bleep am I studying from this book for then?

I need some Beer, wish it was freakin Friday! Any, found this great tutorial here if anyone is interested which really helped a lot so please disregard my latest question here, got it now.

http://www.ahuka.com/dos/index.html

mikehende
07-18-2006, 06:04 PM
Oh, thanks Pete, yes, that works too, I had been told since the beginning that I should adopt the practice of using quotes otherwise I would run into trouble and always forgot this, will try to remember from now on!

PeteF
07-18-2006, 06:27 PM
Mike Meyers is really starting to piss me off:mad: , the Command line section in his book is the worst I've seen, seems to me he himself doesn't understand this but is vainly trying to teach it, I have been stuck on this section for 2 weeks now....[/url]

Mike, when I'm learning a new programming language or anything
technical, I'll usually get 3 books on the topic by 3 different authors.
So many times I've found that no single author explains things clearly
enough, but if you open 3 books by different authors to the same topic
and read all three explanations it suddenly makes perfect sense.
This 3 book technique has helped me countless times.

---pete---

mikehende
07-18-2006, 06:33 PM
That's great advice Pete and I am only now beggining to see this and is why I understand you. The 3 things that have given me hell so far for the most part are Binary/hex, Electricity and now Command line and what got me through these 3 are getting info/help from many different sources, alright so it's not too late, next time I run into something like these 3 mentioned I will immediately seek out different sources of help before eating away at myself, thanks!:)

p.s. No offense to MM, was only venting my frustration, MM does a good job explaining most things.

kerremelk
08-10-2006, 09:17 PM
Hi
when you are in a deeply nested folder and want to go back to root.
cd\

faik, attrib can work on a file it has to find
if it is somewhere in the C: drive
cd\
attrib drawplushelp.doc /s
if you'd want to remove archive attribute
attrib -a drawplushelp.doc /s

alidabiri
10-23-2006, 11:01 AM
To go up two levels, use three periods cd...
To go up three levels, use four periods cd....
so on and so forth cd..... cd...... etc
that's not necessarily true.
the cd command only takes two dots, not three, not four, not .........
you can put as many dots as you want, but it only moves up one level.
cheers.

mikehende
12-07-2006, 01:49 PM
I went to someone's house and their keyboard was not working properly [spill] so pressing ctrl+alt+del could not bring up the Task Manager, the only only other way I knwo is to right click the Taskbar and select it but I am wondering if there is a run box entry which will bring up the Taskbar?

kelly
12-07-2006, 06:50 PM
From Start, Run...
Type in Taskmgr

-td

mikehende
12-08-2006, 05:35 AM
Thanks.

mommalina
12-15-2006, 12:15 AM
From Start, Run...
Type in Taskmgr

-td

Great tip, Tony! Thanks.

Lina