本帖最后由 pcl_test 于 2017-3-24 21:20 编辑
举个栗子- /*&cls
- @echo off&setlocal enabledelayedexpansion
- if "%~1" neq "" (
- set "file=%~1"
- ) else (
- set /p file=请拖入文件并按回车键:
- cls
- for %%a in (!file!) do set "file=%%~fa"
- )
- echo;%file%|cscript -nologo -e:jscript "%~f0"
- pause&exit
- */
- var objShell = new ActiveXObject('Shell.Application');
- var m = WSH.StdIn.ReadLine().match(/^(.+)\\([^\\]+\.[^\.]+)$/i);
- try {
- var objFolder = objShell.NameSpace(m[1]);
- var objItem = objFolder.ParseName(m[2]);
- for (var i=0; i<300; i++){
- var info = objFolder.GetDetailsOf(objItem, i);
- if(info)WSH.echo(objFolder.GetDetailsOf(null, i)+":"+info);
- }
- }catch(e){WSH.echo("路径或文件名无效!");}
复制代码
|