回复 2# cjiabing
多谢提示,只要做个特定的标记就行
这是我刚做批处理有需要简化的地方没.或者其他类似的批处理,现在学习中需要更多实例- goto :kaishi
- ::序号1
- str="将文字复制到剪贴板 我是文本1"
- Set ws = wscript.createobject("wscript.shell")
- ws.run "mshta vbscript:clipboardData.SetData("+""""+"text"+""""+","+""""&str&""""+")(close)",0,true
- createobject("scripting.filesystemobject").getfile(wscript.scriptfullname).delete
-
- ::序号2
- str="将文字复制到剪贴板 我是文本2"
- Set ws = wscript.createobject("wscript.shell")
- ws.run "mshta vbscript:clipboardData.SetData("+""""+"text"+""""+","+""""&str&""""+")(close)",0,true
- createobject("scripting.filesystemobject").getfile(wscript.scriptfullname).delete
-
- ::序号3
- str="将文字复制到剪贴板 我是文本3"
- Set ws = wscript.createobject("wscript.shell")
- ws.run "mshta vbscript:clipboardData.SetData("+""""+"text"+""""+","+""""&str&""""+")(close)",0,true
- createobject("scripting.filesystemobject").getfile(wscript.scriptfullname).delete
-
- ::序号4
- str="将文字复制到剪贴板 我是文本4"
- Set ws = wscript.createobject("wscript.shell")
- ws.run "mshta vbscript:clipboardData.SetData("+""""+"text"+""""+","+""""&str&""""+")(close)",0,true
- createobject("scripting.filesystemobject").getfile(wscript.scriptfullname).delete
- ::tingzhi
-
-
-
- :kaishi
- @echo off&setlocal enabledelayedexpansion
- set "ming="序号1-文本 1" "序号2-文本2" "序号3-文本3" "序号4-文本4""
- set "lu="序号1-%~dp0" "序号2-c:\" "序号3-d:\" "序号4-e:\""
- for /f "skip=1 tokens=*" %%i in ('type "%~f0"') do (
- set ii=%%i
- if "%%i" == "::tingzhi" goto yun
- for %%a in (%ming%) do (
- set w=%%~a
- for %%b in (%lu%) do (
- set l=%%~b
- if "%%i%%i" == "::!w:~0,3!::!l:~0,3!" (
- set "s=!l:~4!!w:~4!.vbs"&&cd.>"!s!"
- )
- )
- )
- if not "!ii:~2,2!" == "序号" (@echo %%i>>!s!)
- )
- :yun
- pause>nul
复制代码
|