MS Dos Command doesn't work

  • Thread starter Thread starter David Sherman
  • Start date Start date
D

David Sherman

In I run a MS DOS command called dir with a switch /w or

dir /w

I get a single column display. On other machines, I get 2 columns.

What happened?

and

How to correct this?

thanks
 
dir /w Displays a list of files and subdirectories in a directory. the /w
switch uses wide list format.

This should work in both cmd.exe and command.com.

Switches may be preset in the DIRCMD environment variable. Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W.

dir /? will display help for the dir command.

[[Presetting dir parameters
You can preset dir parameters by including set with the DIRCMD environment
variable in your Autoexec.nt file. You can use any valid combination of dir
parameters with set dircmd, including the location and name of a file.

For example, to use the DIRCMD environment variable to set the wide display
format (that is, /w) as the default format, type the following command in
your Autoexec.nt file:

set dircmd=/w

For a single use of the dir command, you can override a parameter by using
the DIRCMD environment variable. To do so, type the parameter that you want
to override at the dir command prompt, preceding the parameter with a minus
sign. For example:

dir /-w

To change the DIRCMD default settings, type:

set=NewParameter

The new default settings are effective for all subsequent dir commands until
you use set dircmd again or until you restart your computer.

To clear all default settings, type:

set dircmd=

To view the current settings of the DIRCMD environment variable, type:

set

Set displays a list of environment variables and their settings. ]]
From ...
Command-line referrence in XP HELP
and
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/dir.mspx

Command-line reference A-Z

Start | Run | Copy and paste the following line:

%windir%\hh.exe ms-its:c:\Windows\Help\ntcmds.chm::/ntcmds.htm

Click OK.

I have a shortcut to
%windir%\hh.exe ms-its:c:\Windows\Help\ntcmds.chm::/ntcmds.htm
on my Start Menu.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
David Sherman said:
In I run a MS DOS command called dir with a switch /w or

dir /w

I get a single column display. On other machines, I get 2 columns.

What happened?

and

How to correct this?

thanks

IF you only get two columns on your other machines, I'd suggest you are
using long filenames.
dir/w will give you SIX columns if all of the filenames have 12 or fewer
characters, but if even one filename has thirteen characters (or a
directoryname has 11 characters since DIR puts dirnames in brackets) then
there will be 5 columns.

If any filename has 38 characters or more, you'll get one column. If any one
filename has 24 characters or more, you get 2 columns.

Correct it by using shorter filenames.

HTH

....Bill
 
Wesley Vogel said:
dir /w Displays a list of files and subdirectories in a directory. the /w
switch uses wide list format.

This should work in both cmd.exe and command.com.

Switches may be preset in the DIRCMD environment variable. Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W.

dir /? will display help for the dir command.


Hi Wes

Pardon me jumping in, but there does seem to be a puzzle here.

After reading David's message I tried it out, and found I got the same
result (single-column listing) if I tried to use dir /w on my Backup
folder, which has 33 items and 3 folders. However, the command works if
I use it on my Scripts folder, which contains 36 items and 2 folders.

So then I thought maybe there is a default number of lines at which the
display will split into columns? But no -- C:\Windows (209 files and 54
folders) doesn't work, while C:\, with 30 folders and 1 (visible) file,
does. So does C:\Windows\System32, with 2274 files and 50 folders, so
the problem doesn't seem to be anything to do with size.

I've checked with SET and there is no DIRCMD.
 
Nightowl said:
Hi Wes

Pardon me jumping in, but there does seem to be a puzzle here.


Oops, cancel that -- looks like Bill has solved the mystery.

Thanks, Bill!
 
Yes, Bill solved the problem.

I tried dir /w in a folder with really long file names. ;-) One column.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
Query:

if I do dir /w on my windows directory, I get one column.

If I do a dir /w on my temp directory, I get 2 columns.

I really don't have long file names in the windows directory.

why the diffrence?

thanks
 
Back
Top