Vbs脚本简单使用

之前在做项目时用到了一点vbs脚本,记录下。

C++程序调用vbs脚本

1 System(vbs路径 参数); //空格隔开

Vbs脚本

 1 '''''Vbs脚本解析参数
 2 Set objArgs = Wscript.Arguments
 3 if objArgs.Count>0 Then
 4     msgbox objArgs(0)
 5 end if
 6 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''注释符号
 7 for x = 0 to objArgs.Count-1
 8     msgbox objArgs(x)
 9 next
10 
11 ''''''''''''''''''''''Vbs脚本执行.exe程序'''''''''''''''''
12 Set objShell = CreateObject("Wscript.Shell")
13 commond="D:MyProgramWindTest.exe "+objArgs(0)
14 objShell.Run commond
15 
16 '''''''调用函数(多个参数)''''''''
17 ActiveX1.CapturePicture argv1,argv2

小结

......

原文地址:https://www.cnblogs.com/huangsitao/p/10284307.html