# Solved: Dir *.* /x DOS command under WinXP



## TobievN (Jun 5, 2009)

I had a Hp laptop with WinXP Sp3 which packed up. So I bought a PI945Z mainboard with a 1.8 GHz Intel Celeron processor and 256MB memory and install WinXP SP3 on it. I make rather heavy use of DOS because most of my programs were developed with Borland C Version 3.1 under DOS when I still had the brains to do it. I set the PATH statement in the Windows Environment variables and all goes fine except the following:
When I issue the DOS command "dir *.* /x" to obtain the DOS 8dot3 names of the long file names, the same are not generated for all Windows long file names. I am unable to establish a pattern so as to be able to start looking for a solution or to create a work around. I issued the command while in the C:\Documents and Settings\All Users\Desktop directory (chosen because every WinXP user should have a similar directory on his/her machine) and obtained the following result:
Volume in drive C has no label.
Volume Serial Number is xxx
Directory of C:\DOCUME~1\ALLUSE~1\Desktop
09-05-28 16:45 .
09-05-28 16:45 ..
09-04-19 11:40 775 ACROBA~1 LNK Acrobat.com.lnk
09-04-19 11:39 1,770 ADOBER~1 LNK Adobe Reader 9.lnk
09-05-16 09:37 1,548 AVG Free 8.0.lnk
09-04-19 11:24 1,789 BELARC~1 LNK Belarc Advisor.lnk
09-04-19 11:13 726 IRFANV~1 LNK IrfanView.lnk
09-04-19 12:45 2,393 Nero 8 Essentials.lnk
09-04-19 13:29 849 Smart Defrag.lnk
7 File(s) 9,850 bytes
2 Dir(s) 68,420,849,664 bytes free
As can be seen, 8dot3 names have not been generated for 3 of the 7 files.
Any help to fix this problem will be much, much appreciated.


----------



## TheOutcaste (Aug 8, 2007)

Welcome to TSG!

Looks like something has turned off short file name generation.
The three files in the list without short names are also the three newest.
2009-04-19 12:45 is the oldest with no short name. 2009-04-19 11:40 has a short name, so it occurred at some point between 11:40 and 12:45 on Apr 19.

Sort by date using this in a couple of folders:
*Dir /X /D*, see if this holds true in a few other folders.

Type this at the prompt to check the setting:
*fsutil behavior query disable8dot3*
if it returns *disable8dot3 = *1 it's been disabled.
You can re-enable it with this command:
*fsutil behavior set disable8dot3 0*
Then reboot for it to take affect.

This will not change existing files. To re-create the short name, copy each file to a different folder, delete the original, then move the copy back. It might work if you just copy back over the original, I didn't test that.

Or use *fsutil file setshortname <filename> <shortname>* to specify your own shornames

Shouldn't be to hard to write a batch file to check the short name by using the ~s modifier in a FOR loop. I'm guessing it will return the same name as the long name if there is no short name for a file.
You'd have to check each file name modified on or after 2009-APR-19where the long and short names are equal to see if it should have an 8.3 name, and if it's missing, either copy the file, then copy back (or delete and copy back), or create your own short name, set it, check for errors and create a new short name if needed, etc.

HTH

Jerry


----------



## TobievN (Jun 5, 2009)

Thank you very, very much Jerry. After I did what you prescribed and rebooted, my problem was solved

TobievN


----------

