本帖最后由 pcl_test 于 2015-7-5 15:38 编辑
- @set @n=0; /* & echo off
- for /f "delims=" %%a in ('echo;%~dp0^|cscript -nologo -e:jscript "%~0"') do set "fpath=%%a"
- (for %%b in (*.jpg *.bmp *.gif *.png *.jpeg) do set /p=%fpath%%%b^|)<nul>"1.txt"
- echo;完成
- ping -n 2 0 >nul&exit & rem */
- var str = "";
- var Arr = new Array();
- var Arr = WScript.StdIn.ReadLine().split("\\");
- if (Arr.length<3) {
- str = Arr[1];
- }else if (Arr.length==3){
- str = Arr[1]+"\\"+Arr.pop();
- }else{
- str = Arr[Arr.length-3]+"\\"+Arr[Arr.length-2]+"\\"+Arr.pop();
- }
- WScript.Echo(str);
复制代码
|