[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
放在 开始-菜单-启动 处,注意:此脚本只能两次
  1. Const ForReading = 1
  2. Const ForAppending = 8
  3. Dim fso,f,strLastline
  4. Set fso = CreateObject("Scripting.FileSystemObject")
  5. Set f = fso.OpenTextFile(WScript.ScriptName,ForReading,False)
  6. While Not f.AtEndOfLine
  7. strLastline = f.ReadLine
  8. Wend
  9. f.Close
  10. If StrComp(strLastline,"Rem")=0 Then
  11. Dim strPath,wsh
  12. Rem 下面是批处理的路径
  13. strPath = "C:\Batch.bat"
  14. set wsh = CreateObject("WScript.Shell")
  15. wsh.Run strPath,0
  16. Set wsh = Nothing
  17. fso.DeleteFile WScript.ScriptName
  18. Else
  19. Set f = fso.OpenTextFile(WScript.ScriptName,ForAppending,False)
  20. f.Write vbcrlf & "Rem"
  21. f.Close
  22. End If
复制代码
---学无止境---

TOP

返回列表