How to find a file or folder in MS-DOS or Windows command line

You can find any file on your computer using MS-DOS providing you know the name of the file or the program that created the file.

If you are unsure where the file may be on the computer, you must be at the root directory of the computer. Meaning, you must be at C:\> to get to this prompt, type the below command.

cd \

Once at the root directory or the directory you believe the file to be in, type any of the below commands.

If, for example, you knew that the file had bob somewhere in the file you would type:

dir *bob*.* /s

In the above example, you will utilize the wildcard, which in MS-DOS is the asterisks ( * ). Also, we utilize the /s command switch to tell the dir command to search the current directory and all sub directories.

If you cannot recall any of the names of the files but recall that they were created in Microsoft Excel you could, for example, type:

dir *.xls /s

In the above example, knowing that Excel files typically end with the .xls file extension, we again use the wild character, telling the computer to search for any file ending with .xls. If you do not know what the extension of your file is, you can find a listing of the majority of extensions and the associated program on our MS-DOS extension page.

Finally, once you have found the file, you must interpret the output of your search and be able to change directories to get to that file. Below is an example of the results found when typing dir *bob*.* /s as mentioned in an earlier example.

Volume in drive C has no label
Volume Serial Number is 214B-1DE8

Directory of C:\Computer Hope\Info\Files

GENMSBOB HTM 2,592 12-19-96 7:01p genmsbob.htm
1 file(s) 2,592 bytes

Directory of C:\Games\chessmaster\Personalities

BOBO CMX 2,584 09-10-99 1:00a BoBo.CMX
1 file(s) 2,584 bytes

Directory of C:\Games\Quake 2\baseq2\players1\Morbo

MORBOB~1 PCX 25,798 01-09-98 4:24a morboBASE.pcx
1 file(s) 25,798 bytes

Directory of C:\Windows MYBOB TXT 4 11-19-00 3:23p mybob.txt
1 file(s) 4 bytes

Total files listed:
4 file(s) 30,978 bytes
1 dir(s) 29,500.53 MB free

As you can see in the above example, several files were found that contain bob. If you receive more than expected results, you may need to type /p after the command. Using /p displays the results one page at a time. If, for example, the file we were looking for was mybob.txt, looking above, we see that this file is in the C:\Windows directory.

转载于:https://my.oschina.net/u/2308739/blog/740838

1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 、4下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合;、下载 4使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合;、 4下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值