vbscript

Can I try to ping a website through a specific adapter?

孤街醉人 提交于 2020-06-09 09:27:19
问题 I hope this isn't too basic a question. The title kind of asks it all. :-) 回答1: The ping command will allow strict source routing so you can specify the default gateway to use on the way out. (This assumes your interfaces have distinct gateways i.e. are on different networks) ping -k 192.169.1.1 microsoft.com ^ default gateway for desired interface Using WMI Win32_PingStatus you can do the same thing where you specify SourceRoute and SourceRouteType (This is essentially the same as using ping

Can I try to ping a website through a specific adapter?

帅比萌擦擦* 提交于 2020-06-09 09:26:07
问题 I hope this isn't too basic a question. The title kind of asks it all. :-) 回答1: The ping command will allow strict source routing so you can specify the default gateway to use on the way out. (This assumes your interfaces have distinct gateways i.e. are on different networks) ping -k 192.169.1.1 microsoft.com ^ default gateway for desired interface Using WMI Win32_PingStatus you can do the same thing where you specify SourceRoute and SourceRouteType (This is essentially the same as using ping

How to create multiple application instances in CANoe COM Server Interface

非 Y 不嫁゛ 提交于 2020-06-09 06:27:40
问题 I’m trying write client application to CANoe (application by Vector). I can fully control one application trough COM server objects but if i create a new application instance, gCanAppB, the original instance gCanAppA is closed. How can i tell to the COM Server, that open the new instance in new application window? My source code: Set gCanAppA = CreateObject( "CANoe.Application") Set gCanAppB = CreateObject( "CANoe.Application") gCanAppA.Open ("Easy.cfg") gCanAppA.CAPL.Compile gCanAppA

How to create multiple application instances in CANoe COM Server Interface

浪尽此生 提交于 2020-06-09 06:27:12
问题 I’m trying write client application to CANoe (application by Vector). I can fully control one application trough COM server objects but if i create a new application instance, gCanAppB, the original instance gCanAppA is closed. How can i tell to the COM Server, that open the new instance in new application window? My source code: Set gCanAppA = CreateObject( "CANoe.Application") Set gCanAppB = CreateObject( "CANoe.Application") gCanAppA.Open ("Easy.cfg") gCanAppA.CAPL.Compile gCanAppA

How to make a vbscript loop in loop go to start of code

天大地大妈咪最大 提交于 2020-06-08 13:50:22
问题 When running this code; varCheck=True Do While varCheck Pass=InputBox("Enter Password") Do If IsEmpty(pass) Then WScript.quit Exit Do End If If Pass = "123" Then varCheck=False Exit Do Else varCheck=True MsgBox("Wrong Password...Try Again") End If Loop Loop If the password is wrong then it doesn't restart to the top of the code, it just endlessly loops the "Wrong Password...Try Again" message box. How do I make it ask the password again? (p.s. I'm a newbie at coding so please explain yourself

For each loop issue with pattern

你说的曾经没有我的故事 提交于 2020-05-28 06:35:31
问题 I have a scenario where I'm trying to build a loop with the pattern below. So it goes through the loop and prints out the pattern at the end. My issue is the array is throwing an exception when holding the pattern pattern * ** *** **** *** ** *" I'm having issues because the array is unable to hold the pattern. How else would I be able to construct this loop Sub Main() pattern = Array("'","'*","'**","'***","'**","'*"") Dim patternstyle 'iterating using For each loop. For each item in pattern

Add item to array in VBScript

点点圈 提交于 2020-05-24 08:42:09
问题 How do you add an item to an existing array in VBScript? Is there a VBScript equivalent to the push function in Javascript? i.e. myArray has three items, "Apples", "Oranges", and "Bananas" and I want to add "Watermelons" to the end of the array. 回答1: Arrays are not very dynamic in VBScript. You'll have to use the ReDim Preserve statement to grow the existing array so it can accommodate an extra item: ReDim Preserve yourArray(UBound(yourArray) + 1) yourArray(UBound(yourArray)) = "Watermelons"

How to recode existing text filter for regex search and replace?

天涯浪子 提交于 2020-05-17 18:44:10
问题 I was able to cobble the code below so that it performs multiple search and replace functions as a text filter. The code works in the EditPlus text editor program. I would like to execute the same idea except with regex search and replace. What is the correct way to code for multiple regex Search and Replaces in a text filter? enter code here Option Explicit Dim oWS, oFS Set oWS = WScript.CreateObject("WScript.Shell") Set oFS = WScript.CreateObject("Scripting.FileSystemObject") '---------- '

How to recode existing text filter for regex search and replace?

不问归期 提交于 2020-05-17 18:41:56
问题 I was able to cobble the code below so that it performs multiple search and replace functions as a text filter. The code works in the EditPlus text editor program. I would like to execute the same idea except with regex search and replace. What is the correct way to code for multiple regex Search and Replaces in a text filter? enter code here Option Explicit Dim oWS, oFS Set oWS = WScript.CreateObject("WScript.Shell") Set oFS = WScript.CreateObject("Scripting.FileSystemObject") '---------- '

Insert a new line in a pop up message box created by CreateObject(“WScript.Shell”)

点点圈 提交于 2020-05-17 05:49:46
问题 Sorry but I was trying to find the answer for hours but could not figure it out. I tried playing with vbNewLine and vbCrLf but could not make it to work in the function and in the function call. How do I add a new line with the code below? Tried this but it did not work: checker = MessageTimeOut("Underlying raw data in the workbook has been updated." & vbNewLine & "This will close automatically.", "UPDATE RAW DATA - COMPLETED", 5) Also tried: checker = MessageTimeOut("Underlying raw data in