|
- > "c:\1.bat" echo ren %%1 "%%~n1-%%rq:~0,4%%-%%rq:~5,2%%-%%rq:~8,2%%-%%sj:~0,2%%-%%sj:~3,2%%-%%sj:~6,2%%%%~x1"
- > "%temp%1.vbs" ECHO Set fso=Wscript.CreateObject("Scripting.FileSystemObject")
- >> "%temp%1.vbs" ECHO set f=fso.opentextfile("c:\1.bat")
- >> "%temp%1.vbs" ECHO s=replace(f.readall,"rq", "date")
- >> "%temp%1.vbs" ECHO f.close
- >> "%temp%1.vbs" ECHO set r=fso.opentextfile("c:\1.bat",2,true)
- >> "%temp%1.vbs" ECHO r.write s
- >> "%temp%1.vbs" ECHO Wscript.quit
- > "%temp%2.vbs" ECHO Set fso=Wscript.CreateObject("Scripting.FileSystemObject")
- >> "%temp%2.vbs" ECHO set f=fso.opentextfile("c:\1.bat")
- >> "%temp%2.vbs" ECHO s=replace(f.readall,"sj", "time")
- >> "%temp%2.vbs" ECHO f.close
- >> "%temp%2.vbs" ECHO set r=fso.opentextfile("c:\1.bat",2,true)
- >> "%temp%2.vbs" ECHO r.write s
- >> "%temp%2.vbs" ECHO Wscript.quit
- Start WScript.exe "%temp%1.vbs"
- Start WScript.exe "%temp%2.vbs"
- Reg.exe add "HKCR\*\shell\namedata" /ve /t REG_SZ /d "添加时间" /f
- Reg.exe add "HKCR\*\shell\namedata\command" /ve /t REG_SZ /d "cmd.exe /c c:\1.bat %%1" /f
- del "%temp%1.vbs"
- del "%temp%2.vbs"
复制代码
vbs替换文本的笨办法,我也希望有其他高手能教我更好的方法 |
评分
-
查看全部评分
|