Board logo

标题: DOS字符串操作 [打印本页]

作者: luhuiye     时间: 2009-6-25 22:45    标题: DOS字符串操作

请问下各位! 下面的操作如何实现.
c:\mount\nout\er.gho
这样类型的字符串,如何才能提取最后一个 "\" 连同 这个 反斜杠 提取出来 。
如何实现望各位大侠帮忙答疑解惑。
作者: DOSforever     时间: 2009-6-28 09:54
用 4DOS 的 @path 变量函数

  Quote:
4DOS Help Topic:  @PATH


@PATH[filename]:  Returns the path from a filename, including the drive
letter and a trailing backslash but not including the base name or
extension.

See the notes under Variable Functions about quoting returned long
filenames.

如 echo %@path[c:\mount\nout\er.gho]
返回的就是 c:\mount\nout\
作者: luhuiye     时间: 2009-7-1 22:19
试了可是没用
作者: DOSforever     时间: 2009-7-2 00:37
怎么可能没用,你是怎么试的,说出来看看。