vbscript

Validate vbScript argument names

 ̄綄美尐妖づ 提交于 2021-01-27 18:43:49
问题 I am calling a vbScript from PowerShell, with arguments that are defined in a text string, and I want to validate that the arguments being used are correct. Say my valid arguments are ARG1 , ARG2 & ARG3 , and someone has a string of "/ARGG1:one /ARG2:two" , I want to validate the named arguments against an array of valid arguments and catch that ARGG1 . Where I am failing is in getting the names of the named arguments. I can reference a particular named argument with WScript.Arguments.Named(

Base64 Encode a ZIP file using Classic ASP and VB Script

混江龙づ霸主 提交于 2021-01-27 18:31:32
问题 I have a zip file, which contains one CSV file. I need to Base64 encode this zip file to send to eBay (using their API). I used this website: http://www.opinionatedgeek.com/DotNet/Tools/Base64Encode/ which works nicely, I upload my zip file and it returns a base64 encoded string which eBay likes. I need to do what this website does, but using Classic ASP and VB Script. I already have a base64 encode function, from here: http://www.motobit.com/tips/detpg_base64encode/ so I don't need a script

Call non-default constructor of COM class

我是研究僧i 提交于 2021-01-27 07:59:07
问题 I have a DLL (written in C#) containing a class with 2 Constructors; a default (no arguments) constructor, and another one with 3 arguments. In VBscript, I want to call the second constructor, but CreateObject only receives a classValue parameter, no possible arguments parameters. I guess the underlying implementation of CreateObject uses the system's CoCreateObject function, which according to this answer does not support arguments, but on the other hand there's QTP/UFT's DotNetFactory that

Call non-default constructor of COM class

。_饼干妹妹 提交于 2021-01-27 07:53:22
问题 I have a DLL (written in C#) containing a class with 2 Constructors; a default (no arguments) constructor, and another one with 3 arguments. In VBscript, I want to call the second constructor, but CreateObject only receives a classValue parameter, no possible arguments parameters. I guess the underlying implementation of CreateObject uses the system's CoCreateObject function, which according to this answer does not support arguments, but on the other hand there's QTP/UFT's DotNetFactory that

To keep screen active (without locking) in Windows while running Selenium scripts

南楼画角 提交于 2021-01-24 11:19:11
问题 I am running my Selenium scrips in Windows machine, but during execution after some time the screen gets locked. I have even set Never for Power & Sleep under Settings . But still my laptop screen gets locked during execution. I want to run all my scripts for hours together without getting my laptop screen locked or in sleep mode. How can I achieve this? 回答1: A simple vb script will help you resolve this. Create a .vbs file and paste the below code set wsc = CreateObject("WScript.Shell") Do

To keep screen active (without locking) in Windows while running Selenium scripts

╄→гoц情女王★ 提交于 2021-01-24 11:17:05
问题 I am running my Selenium scrips in Windows machine, but during execution after some time the screen gets locked. I have even set Never for Power & Sleep under Settings . But still my laptop screen gets locked during execution. I want to run all my scripts for hours together without getting my laptop screen locked or in sleep mode. How can I achieve this? 回答1: A simple vb script will help you resolve this. Create a .vbs file and paste the below code set wsc = CreateObject("WScript.Shell") Do

Redirection to standard output in VBS

我怕爱的太早我们不能终老 提交于 2021-01-24 08:10:35
问题 When writing a script in sh or in cmd you can put a > at the end of a line to have the output of that line redirected to a file. If not, it is sent to the standard output. Also, both have the echo command to produce output to the standard output (which can, in turn, be redirected too). How to perform those two things in a VBS script? 回答1: Nothing different. You only need to make sure your scripts are run with the console based script host cscript . myscript.vbs: ' WScript.Echo is a host-aware

Single Line Input VBS Autotyper

杀马特。学长 韩版系。学妹 提交于 2021-01-21 09:22:10
问题 I am currently trying to make an autotyper in VBS and I cannot figure out how to easily input what is to be typed. Right now, this is what my code has to look like: Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.AppActivate "notepad" WScript.sleep 10000 WshShell.SendKeys "H" WScript.Sleep 100 WshShell.SendKeys "e" WScript.Sleep 100 WshShell.SendKeys "l" WScript.Sleep 100 WshShell.SendKeys "l" WScript.Sleep 100 WshShell.SendKeys "o" But I really want my code to have all the text

How can I send a command to another VBScript? [duplicate]

强颜欢笑 提交于 2021-01-20 13:58:51
问题 This question already has answers here : Can I pass an argument to a VBScript (vbs file launched with cscript)? (5 answers) Closed 13 days ago . I need help rendering input through 2 different VBScripts. Here's my code, but I need a way of rendering the input of A.vbs into B.vbs, here's my code: Option Explicit Dim Shell Set Shell = CreateObject("WScript.Shell") Speed = InputBox("How long do you have to wait between clicks, in seconds?", "") Wait = InputBox("How long until this script runs?",

How can I send a command to another VBScript? [duplicate]

僤鯓⒐⒋嵵緔 提交于 2021-01-20 13:58:11
问题 This question already has answers here : Can I pass an argument to a VBScript (vbs file launched with cscript)? (5 answers) Closed 13 days ago . I need help rendering input through 2 different VBScripts. Here's my code, but I need a way of rendering the input of A.vbs into B.vbs, here's my code: Option Explicit Dim Shell Set Shell = CreateObject("WScript.Shell") Speed = InputBox("How long do you have to wait between clicks, in seconds?", "") Wait = InputBox("How long until this script runs?",