这样可以吗?
@echo off
setlocal enabledelayedexpansion
for /f "tokens=*" %%a in ('dir /b /tc /o-d /a *.txt') do (
set NewFile=%%a
goto :next
)
:next
set str=
for /f "usebackq delims=" %%i in ("%NewFile%") do (
for %%j in (%%i) do (
set str=%%j
if "!str:~,1!"=="5" (
set/a n+=1
if !n! equ 1 set str=!str!%%j
if !n! equ 3 set str=!str!&goto :end
)
)
)
goto :eof
:end
mshta vbscript:createobject("wscript.shell").popup(" %ScdLine:~1,-1% !str! ")
不知道你的%ScdLine:~1,-1%从哪里来的,只好跟着你乱写了。
Last edited by HAT on 2008-8-26 at 12:35 AM ]