本帖最后由 apang 于 2014-11-19 11:46 编辑
来个奇葩解:- @set @n=0;/* & echo off
- set "str1=\\server1\share\2.txt"
- for /f "delims=" %%a in ('cscript -nologo -e:jscript "%~0" "%str1%"') do (
- set "str2=%%a"
- )
- echo,%str2%
- pause & exit/b */
-
- s = WScript.Arguments(0).replace(/([a-z]:\\|.*?)(\\)?[^\\]*$/i, "$1");
- WScript.Echo(s)
复制代码
|