中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-18 04:39
47,814 topics / 349,907 posts / today 4 new / 48,259 members
DOS疑难解答 & 问题讨论 (解答室) » [Closed] What is the reason why the dir command cannot find the file when querying the directory?
Printable Version  1,948 / 4
Floor1 namejm Posted 2006-03-29 18:19
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Please ask the following question in English: "What are the possible reasons why the dir command cannot find the file in the command line? The computer is running Windows XP SP2 operating system, and the system partition is in NTFS format, while drive K is in FAT32 format.

"Microsoft Windows XP
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\jm>dir k:
Volume in drive K is Temporary Data
Volume Serial Number is CC6E-12A2

Directory of K:\

File not found"

[ Last edited by willsort on 2006-3-30 at 10:00 ]
Floor2 3742668 Posted 2006-03-29 18:31
荣誉版主 Posts 718 Credits 2,013
Check if "dir /a k:" works.
Floor3 namejm Posted 2006-03-29 21:47
荣誉版主 Posts 1,737 Credits 5,226 From 成都
After checking for a long time, I finally figured out what was going on.
It turned out that it was because the batch processing program was set incorrectly, setting all the files in drive K to the system attribute, resulting in the dir command being unable to obtain the directory list.
Floor4 jun19841 Posted 2006-05-25 00:57
初级用户 Posts 29 Credits 55 From 亚洲
attrib +h /s %drive%\*.exe
Put this batch file in drive D to hide only .exe files on this drive.
If you want to hide .exe files on all drives, how to set the environment variable?
SET can also set environment variables... Can SET replace %?
How to write it then?
Floor5 namejm Posted 2006-05-25 13:38
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Originally posted by jun19841 at 2006-5-25 00:57:
attrib +h /s %drive%\*.exe
Put this batch file in drive D to hide only .exe files in this drive.
If you want to hide .exe files in all drives, how to set the environment variables?
SET can also set environment variables..


You need to use the for statement to list all drives. The code is as follows:


Dare not test it actually, but think that attrib +h /s %%a:\*.exe seems difficult to operate on all .exe files.

[ Last edited by namejm on 2006-5-25 at 13:46 ]
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023