命令提示导航:导航到未知命名的文件夹 [英] Command Prompt Navigation: Navigating To An Unknownly Named Folder

查看:253
本文介绍了命令提示导航:导航到未知命名的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,有没有什么方法来导航你的命令提示符到/通过你不知道的名字的位置?

So, is there any way to navigate your command prompt to/through a location which's name you don't know exactly?

例如情况是我想重命名sei.dat文件及其位于:

For example the situation is i want to rename the sei.dat file and its located at:

C:/ programdata / CsD2 / Tools /(THE UNKNOWN VERSION NAMED FOLDER )/data/per/sei.dat

所以,你可以看到我知道软件安装在哪里,文件夹是根据工具的版本命名的(示例V0.1.2.6),它经常更改。
是否有任何命令或方法将命令提示符导航到文件位置?或者如果没有,是否有任何方法修改文件,而不导航命令提示符到该位置?

So as you can see i know where the software is installed however the folder after "Tools" folder is named after the version of the tools (example V0.1.2.6) and it changes often. Is there any command or way to navigate the Command Prompt to the files location? Or if not is there any way to modify the file without navigating the Command Prompt to the location?

我只是想重命名文件,但我不知道名称

I just want to rename the file but i don't know the name of the folder marked as "THE UNKNOWN VERSION NAMED FOLDER"

推荐答案

测试此操作:

@echo off
for /f "delims=" %%a in ('dir /b /s /a-d "C:\programdata\CsD2\Tools\sei.dat" ') do set "folder=%%~dpa"
if not defined folder echo sei.dat was not found & pause & goto :EOF
cd /d "%folder%"
cmd /k

这篇关于命令提示导航:导航到未知命名的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆