为什么我在CMDE上的别名与输入文件路径时的行为不同?

发布于 2025-01-21 17:11:55 字数 450 浏览 10 评论 0原文

我正在使用cmder,并想制作此filepath:d:\ documents \编程别名(PG),以便我可以在其中键入“ CD /D PG”和CD。当我输入此内容时:

cd /d d:\ documents \ programming < /p>

效果很好,但是当我创建这样的别名时:

别名pg = d:\ documents \ programming

然后输入

cd /d pg < /p>

我得到了这个结果:

系统无法找到指定的路径

?只要注意,我正在使用cmder,但是在终端和Windows CMD中认为混叠是相同的。

I'm using CMDER and want to make this filepath: D:\Documents\Programming an alias (pg), so that I can just type "cd /d pg" and cd there. When I type this:

cd /d D:\Documents\Programming

it works just fine, but when I create an alias like this:

alias pg=D:\Documents\Programming

then enter

cd /d pg

I get this result:

The system cannot find the path specified

Why is that? Just a note, I am using CMDER but figured aliasing is the same across Terminal and Windows CMD.

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

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

发布评论

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

评论(1

楠木可依 2025-01-28 17:11:55

别名pg =“ cd /d d:\ documents \ programming” < /p>

是错误的语法和

别名pg = cd /d d:\ documents \ programming < /p>

在这里重新播放了 @mofi的答案,因为无法将委托标记为答案。如果您希望得到答案,请随时发布答案,我将删除此答案!

alias pg="cd /d D:\Documents\Programming"

is of wrong syntax because of the single " which lets cmd.exe think it should run the file "cd /d D:\Documents\Programming". Define the alias pg with

alias pg=cd /d D:\Documents\Programming

reposted @Mofi's answer here because commments can't be marked as answers. Feel free to post your answer if you want your answer accepted and I'll delete this one!

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