标题: [问题求助] VBS如何把函数的返回值作为变量的值/赋值给变量? [打印本页]
作者: 随风 时间: 2011-2-17 19:38 标题: VBS如何把函数的返回值作为变量的值/赋值给变量?
本帖最后由 pcl_test 于 2017-4-8 05:03 编辑
vbs 如何把命令结果作为变量的值-
- 想把这句获取前一天日期的值取代下面的"strCopy=的值"
- 'wscript.echo dateadd("d",-1,date)
-
- Dim strCopy
- strCopy="此处为你要输入的文本"
- Call SetClipboardText(strCopy)
- Sub SetClipboardText(Text) '写入信息到剪切板
- Dim wsh
- Set wsh = CreateObject("WScript.Shell")
- wsh.Run "mshta vbscript:ClipboardData.SetData("&chr(34)&"text"&chr(34)&"," &Chr(34)& Text &Chr(34)& ")(close)",0,True
- set wsh=Nothing
- End Sub
-
- '下面的是我依葫芦画瓢,虽能完成粘贴动作,但不知有否欠缺,是否应有什么退出语句.望指点.
- dim wshshell
- set wshshell=createobject("wscript.shell")
- wshshell.Sendkeys("^v")
复制代码
作者: 随风 时间: 2011-2-17 23:19
瞎套- Dim strCopy
- strCopy=dateadd("d",-1,date)
- Call SetClipboardText(strCopy)
- Sub SetClipboardText(Text) '写入信息到剪切板
- Dim wsh
- Set wsh = CreateObject("WScript.Shell")
- wsh.Run "mshta vbscript:ClipboardData.SetData("&chr(34)&"text"&chr(34)&"," &Chr(34)& Text &Chr(34)& ")(close)",0,True
- set wsh=Nothing
- End Sub
-
- '模拟按键 粘贴
- dim wshshell
- set wshshell=createobject("wscript.shell")
- wshshell.Sendkeys("^v")
复制代码
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |