vbscript

Calling vba function(with parameters) from vbscript and show the result

巧了我就是萌 提交于 2021-01-28 13:00:32
问题 I have the following vba function ( in a module in Excel file) Public Function validate_fncname(strFncname As String) As Boolean . . . validate_fncname = True End Function and I wrote the following vbscript to call it : Set objExcel = CreateObject("Excel.Application") Set objWorkbook = objExcel.Workbooks.Open("C:\Users\uidu8611\Desktop\CAM0500040F10_SW_Quality_Assurance_Report_Template(new_version).xlsm") objExcel.Application.Visible = True Dim str str ="hello" Dim validate_fncname validate

IIS 10 and Custom Error Pages-Executing Twice

落爺英雄遲暮 提交于 2021-01-28 12:45:18
问题 In response to the infamous "xmlrpc.php" DOS attacks, I wrote custom error ASP pages for both the 404 and the 500-100 type of errors and got most of it working okay. However, I found that the pages are being executed twice, for unknown reason. They both send emails, and also collect the client's IP, for automatic adding to a Peerblock custom IP block list text file. However, because of the double-execution, two (2) emails are sent, and the IP addresses are added twice to the Peerblock text

IIS 10 and Custom Error Pages-Executing Twice

房东的猫 提交于 2021-01-28 12:42:50
问题 In response to the infamous "xmlrpc.php" DOS attacks, I wrote custom error ASP pages for both the 404 and the 500-100 type of errors and got most of it working okay. However, I found that the pages are being executed twice, for unknown reason. They both send emails, and also collect the client's IP, for automatic adding to a Peerblock custom IP block list text file. However, because of the double-execution, two (2) emails are sent, and the IP addresses are added twice to the Peerblock text

VBScript - Retrieving a user's nested groups and getting rid of repetitions

一笑奈何 提交于 2021-01-28 12:13:47
问题 For my work, I have to write a script in VBScript that retrieves a list of ALL groups a user belongs to, including nested groups, and take out nested groups that would be repeated throughout the list (as well as indent nested groups, further indent nested groups of nested groups, etc.) I found a script that fetches the entire list of groups a user belongs to by Monimoy Sanyal on gallery.technet.microsoft.com, and tried to adapt it to my needs. Here is the script as edited by me: Option

How to check whether a process is running using VB script?

Deadly 提交于 2021-01-28 08:55:04
问题 I have the following VB Script which opens a particular window a performs Certain functions in the window. WScript.Sleep 10000 Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "Notepad" #perform some function WScript.Sleep 10000 I need to repeat same code when notepad is closed so that same notepad is opened again.I tried the following code for that purpose WScript.Sleep 10000 Set WshShell = WScript.CreateObject("WScript.Shell") If (WshShell.AppActivate("Notepad") = False)

How to check whether a process is running using VB script?

两盒软妹~` 提交于 2021-01-28 08:37:12
问题 I have the following VB Script which opens a particular window a performs Certain functions in the window. WScript.Sleep 10000 Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "Notepad" #perform some function WScript.Sleep 10000 I need to repeat same code when notepad is closed so that same notepad is opened again.I tried the following code for that purpose WScript.Sleep 10000 Set WshShell = WScript.CreateObject("WScript.Shell") If (WshShell.AppActivate("Notepad") = False)

How to have vbs launch a program as administrator?

ぃ、小莉子 提交于 2021-01-28 05:42:42
问题 The end of my VBScript (the rest is mainly WScript.Echo reminders) looks like this (launches X-Plane, maximized): Set objShell = WScript.CreateObject( "WScript.Shell" ) objShell.Run("""X:\X-Plane\X-Plane.exe"""), 3 Set objShell = Nothing What would I need to add to this to get X-Plane to run as administrator? An hour's Googling has got me nowhere! 回答1: Provided you have UAC enabled and your user is a member of the Administrators group you can use the ShellExecute method with the "runas" verb:

VBScript: XPath Query with multiple namespaces

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-28 02:35:19
问题 What XPath query should I use to get to the GetLogisticsOfferDateResult Node? I have attached the vbscript that I'm using. I suspect the problem has to do with the multiple namespaces in the document. But how do I reference the second namespace in the XPath? Dim responseXML responseXML = '"<s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/""><s:Body><GetLogisticsOfferDateResponse xmlns=""http://schneider-electric.com/OrderEntryService""><GetLogisticsOfferDateResult>2010-07-20<

VBScript: XPath Query with multiple namespaces

馋奶兔 提交于 2021-01-27 21:29:09
问题 What XPath query should I use to get to the GetLogisticsOfferDateResult Node? I have attached the vbscript that I'm using. I suspect the problem has to do with the multiple namespaces in the document. But how do I reference the second namespace in the XPath? Dim responseXML responseXML = '"<s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/""><s:Body><GetLogisticsOfferDateResponse xmlns=""http://schneider-electric.com/OrderEntryService""><GetLogisticsOfferDateResult>2010-07-20<

How mark Scripting.FileSystemObject as safe for scripting?

故事扮演 提交于 2021-01-27 20:32:16
问题 Introduction: I'm programing a CNC machine. To be exact a Rover from Biesse. The editor from the software that is used to programing support VBScript. VBScript is used for implementing conditional statments and loops etc. In instruction to the software i have listed all syntax from VBScript marked as not to be used to avoid complication :) Of course I would like to use VBScript :) To be exact - to open txt file and set up program base on the content. The main problem: All the syntax of the