在批处理脚本中获取文件父目录的全名
I need to write a batch script to find out the full path to any given file's parent directory. Now, I'm completely new to batch scripts, so I need someone to lend me a hand with this :P
There is a similar question here on SO, but it's not what I'm looking for.
Any help is much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
来自 http: //blogs.msdn.com/b/ben/archive/2007/03/09/path-manipulation-in-a-batch-file.aspx
如果 %I 是您的变量:
From http://blogs.msdn.com/b/ben/archive/2007/03/09/path-manipulation-in-a-batch-file.aspx
If %I is your variable:
这应该能很好地达到目的!
这将输出以下行:
This should do the trick quite nicely!
This will output the following line:
我认为我找到了一个相当好的方法,虽然它不是最好的方法:
但最后,我发现这个方法是最好的方法:
I think I found a pretty good method although it isn't the best one:
But finally, I discovered this method is the best one: