# XP-Command Prompt



## Frecon (Aug 31, 2004)

I,m having trouble with a command. When i enter the following command
"C:\>attrib c:windows/system32 -h -s" without the quotes it keeps returning me to C:\>. Am i doing something wrong in regards to spaces and capitalizations? I,m not sure which switches to use and in what sequence. I hope this makes the question clearer. tks.


----------



## DoubleHelix (Dec 10, 2004)

The command completed successfully.


----------



## ChuckE (Aug 30, 2004)

With no message back, the simple returning back to the C:\ prompt, is the indication that it worked. You can verify by entering the command:
*attrib c:\windows\system32*
which should now return with " C:\windows\system32"

By the way, you really ought to use the proper syntax in entering the command, in that the "bash" (\ or back-slash) is used for directory separators and the "slash" (/) is used for switches in commands.
It is odd that the command worked anyway, but you should not depend on it. It is better to follow proper syntax, as in:
*attrib c:\windows\system32 +h +s*


----------



## RGregory (Jul 27, 2005)

If you go to the directory where the file is, and just type the attrib command, it will return with a list of files in the directory with their attributes listed.


----------



## ChuckE (Aug 30, 2004)

Notice that Frecon changed the attributes of a directory.

To use the command, as you suggest, to additionally display the directories, you need to add "/s /d" UNLESS you specify just that one directory you are interested in.


----------



## Frecon (Aug 31, 2004)

Thanks for all the suggestions but the closest i got was to have a list of two directories - system32 and 1386 but not the contents of the directories which was my quest. It said the "/s/d" was an invalid command whether i used the quotes or not. Further enlightenment wld be appreciated.


----------



## ChuckE (Aug 30, 2004)

1) From your original posting you never said what it is that you wanted, and I still am not sure. But it looked like all you originally wanted to do was change the attributes of the system32 directory, and that is what we said you had done.

2) Now you mention that you got a list of the two directories (system32 and 1386 ??, perhaps you mean i386 ?? - and that's the first time you mentioned that one), but not the contents. That's confusing as well.  What do you consider a list of the directory that the contents is not? To me that is the same thing. But perhaps you should just tell us just what it is that you really are striving for.

3) If you are getting an "invalid command" error when using the switches "/s /d" AND while you were using the "attrib" command then the reason is either you mistyped something OR you did not put a space between the two switches "/s" and "/d"
Look back at my first mention or those switches and see that I had a space there. Your mention of it does not show the space. AND NO YOU DO NOT USE THE QUOTES, (when did I use quotes in that *bolded* command line example?).
The command would be:
*attrib c:\windows\system32 +h +s*
to change the attributes of the system32 directory.

If that is not what you want to do, then what is it you want to do?


----------



## Frecon (Aug 31, 2004)

To ChuckE. Tks for the scolding. I know how to get to system 32 through c:/windows and see all the files. I wanted to further that knowledge a bit by trying to do the same thing from the command prompt and what i found on Google apparently was something different i.e. 'changing the attributes'. You all say that i had it right the first time and apparently changed the atrtibutes which is not what i had in mind. Now that i,ve made a mess?, can you help put me back where i was or finish what i was trying to do. thanks again.


----------



## DoubleHelix (Dec 10, 2004)

You successfully ran a command that removed the hidden and system attributes from the C:\Windows\System32 folder.

If you want to undo it, run the following at the C:> prompt:

C:>attrib C:\Windows\System32 +h +s

Your "mess" will be undone. Just get the slashes right. You've typed them here wrong. '\' is different from '/'.


----------



## Frecon (Aug 31, 2004)

Thank you ChuckE and DoubleHelix and others. Everything is back to normal. In future. i will try to ask the questions more completely and precisely. Thanks again.


----------



## ChuckE (Aug 30, 2004)

Frecon, it is not so much a scolding as it is a request for details. But anyway...
To see the files, that is, to see the list of files in any directory, via the DOS prompt you just use the *DIR* command.

If you are in the directory of choice that you only need to type *DIR* and press return. To get into the directory of choice (but you don't need to be -read later) you can just use the *CD somepath* command, where somepath would be the required path to get to where you want to be.

There are additional switches you can add after the *DIR* command to additionally modify the results to list directories only, or hidden files, modify the display results. To find out what those switches are just add the single switch */?* after the command, as in: *DIR /?*
The space is not needed here, after the *DIR*, but for consistency, and good practice, you ought to use the space. Also, case does not matter.

If you are not in the directory of choice you can still just specify the path to what you want to see the directory listing of. You can do that by additionally reading the *DIR /?* page. Part of that is like this:
*DIR* to get the list of where you are at.
*DIR x:* to get the list of another drive "x", which is usually the top, or root, but if you have a past path on that drive that you last set, the result will be of that drive's path.
*DIR x:\* to get a list of that drive "x" and this will be of the root.
*DIR \somedir\otherdir\nutherdir* to get a list of the files from the current drive, but in the path specified from the root. This means it doesn't matter what directory you are in at the time, since you are specifying exactly how to get there from the root.
*DIR somedir\otherdir\nutherdir* to get a list of the files at the path that is in addition to the current path you are in (notice there was no lead "bash" (\) here. That means if you are in directory "C:\xdir\ydir" your results would be of the directory (assuming it exists) "C:\xdir\ydir\somedir\otherdir\nutherdir"
*DIR x:\somedir\otherdir\nutherdir* to get a list of files on the specified drive (which may or may not be the one you are on) and the exact directory path you specified (assuming it exists).

Hope some of that helps. And what really helps is picking up a simple book that explains all that, like the "Dummies" series (bad name, but good books) and also a bit of experimentation on your part. Good luck! and have fun!


----------



## JohnWill (Oct 19, 2002)

DoubleHelix said:


> You successfully ran a command that removed the hidden and system attributes from the C:\Windows\System32 folder.
> 
> If you want to undo it, run the following at the C:> prompt:
> 
> ...


YIKES! DON'T DO THAT! Most of the files in \WINDOWS\SYSTEM32 do not normally have the hidden and system attributes set, so you sure don't want to jump in there and make a bad situation worse! Take my system as an example, out of the 2056 files in \WINDOWS\SYSTEM32, here's the list that had any of those attributes set. I don't think setting all of them is a good idea...

A R C:\WINDOWS\system32\atl71.dll
A HR C:\WINDOWS\system32\cdplayer.exe.manifest
A R C:\WINDOWS\system32\ctl3dv2.dll
A R C:\WINDOWS\system32\e1000325.din
A R C:\WINDOWS\system32\e1000msg.dll
A R C:\WINDOWS\system32\IntelNic.dll
A R C:\WINDOWS\system32\KBDAL.DLL
A R C:\WINDOWS\system32\kbdaze.dll
A R C:\WINDOWS\system32\kbdazel.dll
A R C:\WINDOWS\system32\kbdblr.dll
A R C:\WINDOWS\system32\kbdbu.dll
A R C:\WINDOWS\system32\kbdcr.dll
A R C:\WINDOWS\system32\kbdcz.dll
A R C:\WINDOWS\system32\kbdcz1.dll
A R C:\WINDOWS\system32\kbdcz2.dll
A R C:\WINDOWS\system32\kbdest.dll
A R C:\WINDOWS\system32\kbdgkl.dll
A R C:\WINDOWS\system32\kbdhe.dll
A R C:\WINDOWS\system32\kbdhe220.dll
A R C:\WINDOWS\system32\kbdhe319.dll
A R C:\WINDOWS\system32\kbdhela2.dll
A R C:\WINDOWS\system32\kbdhela3.dll
A R C:\WINDOWS\system32\kbdhept.dll
A R C:\WINDOWS\system32\kbdhu.dll
A R C:\WINDOWS\system32\kbdhu1.dll
A R C:\WINDOWS\system32\kbdkaz.dll
A R C:\WINDOWS\system32\kbdkyr.dll
A R C:\WINDOWS\system32\kbdlt.dll
A R C:\WINDOWS\system32\kbdlt1.dll
A R C:\WINDOWS\system32\kbdlv.dll
A R C:\WINDOWS\system32\kbdlv1.dll
A R C:\WINDOWS\system32\kbdmon.dll
A R C:\WINDOWS\system32\kbdpl.dll
A R C:\WINDOWS\system32\kbdpl1.dll
A R C:\WINDOWS\system32\kbdro.dll
A R C:\WINDOWS\system32\kbdru.dll
A R C:\WINDOWS\system32\kbdru1.dll
A R C:\WINDOWS\system32\kbdsl.dll
A R C:\WINDOWS\system32\kbdsl1.dll
A R C:\WINDOWS\system32\kbdtat.dll
A R C:\WINDOWS\system32\kbdtuf.dll
A R C:\WINDOWS\system32\kbdtuq.dll
A R C:\WINDOWS\system32\kbdur.dll
A R C:\WINDOWS\system32\kbduzb.dll
A R C:\WINDOWS\system32\kbdycc.dll
A R C:\WINDOWS\system32\kbdycl.dll
A HR C:\WINDOWS\system32\logonui.exe.manifest
A S R C:\WINDOWS\system32\msstkprp.dll
A R C:\WINDOWS\system32\msvcp71.dll
A R C:\WINDOWS\system32\msvcr71.dll
A HR C:\WINDOWS\system32\ncpa.cpl.manifest
A HR C:\WINDOWS\system32\nwc.cpl.manifest
R C:\WINDOWS\system32\perfmon.msc
A R C:\WINDOWS\system32\Prounstl.exe
R C:\WINDOWS\system32\rsop.msc
A HR C:\WINDOWS\system32\sapi.cpl.manifest
A HR C:\WINDOWS\system32\WindowsLogon.manifest
A HR C:\WINDOWS\system32\wuaucpl.cpl.manifest


----------



## ChuckE (Aug 30, 2004)

Without specifying the files, or wildcard of files, to change, just the directory would have been made unhidden (the +h) and made un-system-like (the +s). No worries, other than making the system32 folder visible.

By the way, Frecon, you do not have to make the hidden folders un-hidden to do a *DIR* of them. If you specify a folder, hidden or not, the internal visible contents will be listed.

One more point, Frecon, instead of using the command prompt to see these files, why don't you just use Windows Explorer? If the files, or directories, are hidden you can easily make them visible for you by changing the Folder options to view hidden files and folders.
(In Windows Explorer, select Tools>Folder Options, tab View, setting Hidden files and folders=Show...)


----------



## Frecon (Aug 31, 2004)

To ChuckE and John Will. Thank you for taking the trouble to expand on previous comments and answers to my newbie attempt at the command prompt. I somewhat innocently took a command out of thin air to see if i cld get a directory listing using the command prompt. This came about somewhat because every time i look at a directory list in WE it seems that there are less files or a lot more different files than the last time i looked. I thought going through the command prompt wld give a definitive list of the folders and sub-folders (files). That,s where i came from and i,ll take your advice into account for future progress. Thanks again.


----------



## ChuckE (Aug 30, 2004)

Frecon, learning DOS can be rewarding, archaic, frustrating, slow, useful, painful, and just plain fun. If that is your intent then invest $10-20 and find one of those dummy-type books.

Also there is a fair bit of details built right into the commands themselves. Just type the command you are curious about and follow with a " /?" (no quotes, just a <space><slash><question mark>). That may show you some usage information and syntax details.

One last point, you might even type "HELP" on a line (again NO QUOTES!) and press the Enter key. If HELP is there, you will see a list of one-liner details about most of the commands.

Again, have fun.


----------



## iaavagent (Jan 11, 2004)

Since we are on the subject, could ya'll look at this site and explain what this guy is talking about. What prompt? the one in programs or F8 and is it true defrag can be run on C from a command prompt in XP?

http://www.networkclue.com/os/Windows/commands/index.php

Thanks


----------



## JohnWill (Oct 19, 2002)

No mystery here, there's a command line defrag interface. I opened a command prompt and typed:

C:\>defrag /?
Usage:
defrag <volume> [-a] [-f] [-v] [-?]
volume drive letter or mount point (d: or d:\vol\mountpoint)
-a Analyze only
-f Force defragmentation even if free space is low
-v Verbose output
-? Display this help text

So I figured I'd let it defrag my scratch drive.

C:\>defrag e:
Windows Disk Defragmenter
Copyright (c) 2001 Microsoft Corp. and Executive Software International, Inc.

Analysis Report
64.45 GB Total, 61.43 GB (95%) Free, 0% Fragmented (1% file fragmentation)

Defragmentation Report
64.45 GB Total, 61.43 GB (95%) Free, 0% Fragmented (0% file fragmentation)

C:\>


----------



## Frecon (Aug 31, 2004)

To ChuckE. Thanks again for sticking with me for more info. I have now progressed to using /? and DIR and Help and have been able to move the info to the clipboard and print it. I will get the book "DOS for Dummies" and also zero in on specific explanations on Google. I,m 73 and have only had a computer for fourteen months. I,ve bot two manuals but have found out along the way that if i search hard enough on Google I can get the specific instructions i,m looking for and useful to the point tutorials. Plus of course the help sites such as this one. Thanks again.


----------



## ChuckE (Aug 30, 2004)

Some web places for DOS help (this is not an exhaustive list, just some that I keep around):
http://home7.inet.tele.dk/batfiles/msdos7/
http://www.computerhope.com/msdos.htm

I find these are a couple nice reference sites, for detailing the syntax and usage of most DOS commands. Many more can easily be found, as you have learned, by Googling.

Good luck, and have fun. I hope that I am as inquisitive of computers (or whatever is the "thing" to have) and have a desire to learn when I get to be your age. (I'm 58.)


----------



## iaavagent (Jan 11, 2004)

Can you d/L a DOS Shell and use it like in the old days. Can you add to it, if so?

Sorta shortcuts the need for knowing how to type in all those commands, right?
Just asking as I really don't know what I'm talking about and that's the truth!
I guess you already figured that out!


----------



## ChuckE (Aug 30, 2004)

Depending upon what you are currently using, what OS if any (i.e. Mac? Windows? what version?) you may not need to get anything.

Tell us what you currently are using. And we can go from there.

Actually, this might get involved, and it will clutter up the thread that someone else started. So this is off (original) topic. It would be better if you go to the DOS forum and repost.


----------



## iaavagent (Jan 11, 2004)

Thanks Chuck, will do. {Have W95 on one and Wxp home on another}


----------



## ChuckE (Aug 30, 2004)

Both Win95 and WinXP have a DOS command window that you can open from the Start>Programs button. Look under Accessories, for something like "Command Prompt" or "MS-DOS Prompt"

After that opens, just see if whatever command you want to try works.
For help, just try entering help. Reread the messages already posted in this thread, perhaps now they'll mean something to you.

And be sure to get those books.


----------

