我有一个很诡异的问题-
- echo Set SelPath = CreateObject("Shell.Application").BrowseForFolder(0,"请选择文件夹",0)>%tmp%\test.vbs
- echo If SelPath Is Nothing Then WScript.Quit>>%tmp%\test.vbs
- echo TreePath = SelPath.self.Path ^& "\">>%tmp%\test.vbs
- echo WScript.echo TreePath>>%tmp%\test.vbs
- For /F "delims=#" %%i in ('CScript //nologo %tmp%\test.vbs') Do Set Var=%%i
- if exist %tmp%\list.txt del %tmp%\list.txt /q
- :input11
- set input=%Var%
- set "input=%input:"=%"
- if "%input%"==":" goto input11
- if not exist "%input%" goto input11
- for %%i in ("%input%") do if /i "%%~di"==%%i goto input11
- pushd %cd%
- cd /d "%input%">nul 2>nul || exit
- set cur_dir=%cd%
- popd
- for /f "delims=" %%i in ('dir /b /a-d /s /os "%input%"') do echo %%~dpnxi>>%tmp%\list.txt
- if not exist %tmp%\list.txt goto no_file11
- start /w %tmp%\list.txt
复制代码 可以列出你选择的文件夹下的所有文件名,但是我不想列出子文件夹的文件名,所以删除了/s时,返回的路径是错误的,为什么会这样?应该怎样修改?
[ 本帖最后由 Wingl83 于 2010-10-21 20:47 编辑 ] |