感谢版主的帮助,小弟有些小问题请版主相告:
1、我把这段代码复制到名为 文本文档.txt里,
2、是不是从第10行和第18行开始改成自己实际路径。您看是这样吗?- @rem 保存我为 AutoWork.bat
- @echo off
- if not exist Work.vbs more +6 "%~f0">Work.vbs
- at 6:00 /interactive "Work.vbs"
- exit
-
- Dim wsh,strPath,fso
- Set fso = CreateObject("Scripting.FileSystemObject")
- Rem 下面是程序的路径
- strPath = "C:\PROGRA~1\Dos\Dos.exe 212.1.30.45"
- set wsh = CreateObject("WScript.Shell")
- fso.CreateFolder wsh.SpecialFolders("Desktop") & "\" _
- & DatePart("yyyy",Date) & "-" _
- & DatePart("m",Date) & "-" _
- & DatePart("d",Date)
- wsh.Run strPath
- WScript.Sleep 3000 '延时3秒
- wsh.SendKeys "qwe2100"
- WScript.Sleep 500
- wsh.SendKeys "{enter}"
- WScript.Sleep 500
- wsh.SendKeys "qqq111"
- WScript.Sleep 500
- wsh.SendKeys "{enter}"
- WScript.Sleep 500
- wsh.SendKeys "DELETE"
- WScript.Sleep 500
- wsh.SendKeys "sh bbw.sh"
- WScript.Sleep 500
- wsh.SendKeys "{enter}"
- WScript.Sleep 500
- wsh.SendKeys "qqq11100"
- WScript.Sleep 500
- wsh.SendKeys "{enter}"
- WScript.Sleep 500
- wsh.SendKeys "20100101"
- WScript.Sleep 500
- wsh.SendKeys "{enter}"
- WScript.Sleep 500
- wsh.SendKeys "20100228"
- WScript.Sleep 500
- wsh.SendKeys "{enter}"
- Rem 重复用上面的步骤直到输入完你要输入的值
复制代码 3、@rem 保存我为 AutoWork.bat,是啥意思?是说要将文本文档.txt的名和扩展名改成autowork.bat吗?
4、运行这个批处理后,在桌面上自动生成了一个Work.vbs。但是并没有生成文件夹。我只有双击work.vbs后,才会出现文件夹和打开DOS,并录入了相应命令。这都是靠人工打开才有的呀? |