有什么办法可以访问命令提示符中的.cmd文件路径?

发布于 2025-02-13 21:43:44 字数 113 浏览 1 评论 0原文

我有一个.cmd文件,我想在其中编写一些代码。但是首先,我希望一个代码打开.cmd文件路径,并且当有人单击我的.cmd文件时,它是在命令提示符中打开的。谁能帮我吗?
谢谢

I have a .cmd a file and I want to write some code in it. But first of all I want a code to open the .cmd file path and when someone clicks my .cmd file, it's dir opens in command prompt. Can anyone help me with this?
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

挥剑断情 2025-02-20 21:43:44

是什么意思是“打开命令提示”?如果您想从当前dir 中使用新的CMD窗口,只需添加以下命令:

start cmd

或者即使

start cmd @cmd /k dir

您想请在该窗口中查看当前目录的内容。另外,您可以打开Windows Explorer中的当前文件夹 - 只需将其添加到您的文件命令:

explorer .

What's mean 'dir opens in command prompt'? If you want to open new cmd window from current dir, just add to your file the following command:

start cmd

Or even

start cmd @cmd /k dir

if you want to see a content of the current directory in that window. Also you can open the current folder in Windows Explorer - just add to your file this command:

explorer .
抹茶夏天i‖ 2025-02-20 21:43:44

固定
只需在.cmd文件中复制此代码:

cd /d %~dp0
call cmd

fixed
Just copy this code in your .cmd file:

cd /d %~dp0
call cmd
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文