locked
dir returns "File Not Found" but dir * returns a list of files RRS feed

  • Question

  • In windows 7 dir returns File Not Found but dir * returns a list of files


    C:\Users>dir
     Volume in drive C is MAIN
     Volume Serial Number is 22D8-51BB

     Directory of C:\Users

    File Not Found

    C:\Users>dir *
     Volume in drive C is MAIN
     Volume Serial Number is 22D8-51BB

     Directory of C:\Users


     Directory of C:\Users

    07/23/2013  11:42 AM    <DIR>          norman
    07/22/2013  01:49 PM    <DIR>          christian.nygren
    07/22/2013  01:48 PM    <DIR>          ..
    07/22/2013  01:48 PM    <DIR>          .
    05/22/2013  09:45 AM    <DIR>          paul
    05/07/2013  08:30 AM    <DIR>          liu-duan
    12/14/2012  10:53 AM    <DIR>          Public
    10/08/2012  03:51 PM    <DIR>          woody
    12/06/2011  12:43 PM    <DIR>          geosupport
    12/06/2011  12:33 PM    <DIR>          testuser
    12/06/2011  12:33 PM    <DIR>          liuduan
                   0 File(s)              0 bytes
                  11 Dir(s)  407,734,743,040 bytes free

    Tuesday, July 23, 2013 7:59 PM

Answers

  • C:\>set dir

    DIRCMD=dir /O-D

    Here is your reason: Someone pre-configured the dir command on your machine so that it shows files only but not folders. You should delete the "dircmd" environmental variable if this is not what you want.
    Wednesday, July 24, 2013 4:33 PM

All replies

  • - Does the difference persist when you boot into Safe Mode?
    - What do you get when typing this command?
       set  dir

    Wednesday, July 24, 2013 7:46 AM
  • Safe mode with terminal behaves the same way.


    C:\>set dir
    DIRCMD=dir /O-D

    These are the cmd.exe files I have on my computer. Can one of these have changed? Is somehow cygwin interfering?

    C:\>dir/s cmd.exe
     Volume in drive C is MAIN
     Volume Serial Number is 22D8-51BB

     Directory of C:\cygwin\usr\share\info

    10/05/2011  10:58 AM            11,674 dir
                   1 File(s)         11,674 bytes

     Directory of C:\Program Files (x86)\GnuWin32\info

    12/28/2007  04:40 PM             1,132 dir
                   1 File(s)          1,132 bytes

     Directory of C:\Windows\System32

    11/20/2010  08:24 AM           345,088 cmd.exe
                   1 File(s)        345,088 bytes

     Directory of C:\Windows\SysWOW64

    11/20/2010  07:17 AM           302,592 cmd.exe
                   1 File(s)        302,592 bytes

     Directory of C:\Windows\winsxs\amd64_microsoft-windows-commandprompt_31bf3856ad364e35_6.1.7600.16385_none_e701b864340d9016

    07/13/2009  08:39 PM           344,576 cmd.exe
                   1 File(s)        344,576 bytes

     Directory of C:\Windows\winsxs\amd64_microsoft-windows-commandprompt_31bf3856ad364e35_6.1.7601.17514_none_e932cc2c30fc13b0

    11/20/2010  08:24 AM           345,088 cmd.exe
                   1 File(s)        345,088 bytes

     Directory of C:\Windows\winsxs\wow64_microsoft-windows-commandprompt_31bf3856ad364e35_6.1.7600.16385_none_f15662b6686e5211

    07/13/2009  08:14 PM           301,568 cmd.exe
                   1 File(s)        301,568 bytes

     Directory of C:\Windows\winsxs\wow64_microsoft-windows-commandprompt_31bf3856ad364e35_6.1.7601.17514_none_f387767e655cd5ab

    my path

    PATH=C:\Perl64\site\bin;C:\Perl64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\MATLAB\R2013a\runtime\win64;C:\Program Files\MATLAB\R2013a\bin;C:\Program Files\MATLAB\R2011b\runtime\win64;C:\Program Files\MATLAB\R2011b\bin;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files\MySQL\MySql Server 5.5\bin;C:\Program Files (x86)\GnuWin32\bin;C:\Program Files (x86)\Windows
    Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\

    Wednesday, July 24, 2013 4:29 PM
  • C:\>set dir

    DIRCMD=dir /O-D

    Here is your reason: Someone pre-configured the dir command on your machine so that it shows files only but not folders. You should delete the "dircmd" environmental variable if this is not what you want.
    Wednesday, July 24, 2013 4:33 PM
  • Thanks. That fixed it.

    Thanks again.

    Wednesday, July 24, 2013 6:52 PM
  • Hi,

    Glad to hear this issue has been solved.

    Regards,


    Vincent Wang
    TechNet Community Support

    Thursday, July 25, 2013 3:16 AM
  • Hello!

    Thank you for your support. However, the workaround does not solve this issue.

    1. Nobody, unless I have an evil hacker fiddling with my laptop behind my back and knows my password, has modified the factory environment setting for the DIR command.

    2. I can still verify that my files can be found using the Windows 8.1 Explorer GUI, but no matter what, the DIR command gets "lazy" and as soon as I press the Enter key, it instantly says "file not found" on a 1 TB hard drive filled over 60% with files of all sorts! It's impossible to reply back such results on this rather large drive that quickly.

    3. Tried the fix of changing the DIR environment settings. Same results.

    4. I tried setting the directory and files properties to "everybody" on "Full Access", and still no avail.

    5. Curiously, the bigger 3 TB drive (connected to the same laptop) has no such odd behavior, and both drives appear to be OK when manually "chkdsk"'d. On the latter, when I perform the same search command, it takes a couple of seconds and then it shows me the files that met the search criteria. Flawlessly.

    This issue it's still pending solution.

    • Edited by AlejandroBello Monday, September 15, 2014 2:06 PM more details added
    Monday, September 15, 2014 2:01 PM
  • This issue it's still pending solution.


    This issue was resolved 14 months ago. If you have a new problem then you should create a new thread instead of appending your question to someone else's post.
    Monday, September 15, 2014 3:55 PM
  • This issue it's still pending solution.


    This issue was resolved 14 months ago. If you have a new problem then you should create a new thread instead of appending your question to someone else's post.

    I am unable to resolve similar issue as above and volume in drive c has no label, volume serial number is 3CB2-209E, Directory of C:\  File not found. I need a prompt response. thanks

    Monday, January 25, 2016 8:54 AM
  • This issue was resolved 14 months ago. If you have a new problem then you should create a new thread instead of appending your question to someone else's post.

    I am unable to resolve similar issue as above and volume in drive c has no label, volume serial number is 3CB2-209E, Directory of C:\  File not found. I need a prompt response.

    I am flabbergasted.
    Monday, January 25, 2016 1:33 PM