vbscript

How to read row details of a GuiTree control using GUI Script

与世无争的帅哥 提交于 2020-12-12 07:53:27
问题 I need to read a specific column value of the last row of the below Variant table in SAP. When I record the script to navigate through the rows of the table, I get below lines. I need to extract specific cell value. Manually, I can copy and paste the content of the row to note pad. But, I am unable to figure out how to read the content of the specific column or entire row. I have been trying different ways: session.findById("wnd[0]/usr/subTABSTRIP:SAPLATAB:0100/tabsTABSTRIP100/tabpTAB06/" _ &

How to read row details of a GuiTree control using GUI Script

一笑奈何 提交于 2020-12-12 07:53:22
问题 I need to read a specific column value of the last row of the below Variant table in SAP. When I record the script to navigate through the rows of the table, I get below lines. I need to extract specific cell value. Manually, I can copy and paste the content of the row to note pad. But, I am unable to figure out how to read the content of the specific column or entire row. I have been trying different ways: session.findById("wnd[0]/usr/subTABSTRIP:SAPLATAB:0100/tabsTABSTRIP100/tabpTAB06/" _ &

Trying to redirect stdout to a file

馋奶兔 提交于 2020-12-12 04:42:32
问题 I'd like to send the stdout to a logfile with a datestamp and location for each printer. On Error resume Next Dim objNetwork, StdIn, StdOut 'Initialize the printer connections object Set objNetwork = CreateObject("WScript.Network") Set StdIn = WScript.StdIn Set StdOut = WScript.StdOut 'Connect each printer objNetwork.AddWindowsPrinterConnection "\\server\pr01" objNetwork.AddWindowsPrinterConnection "\\server\pr02" objNetwork.AddWindowsPrinterConnection "\\server\pr03" 'Remove old printers

Trying to redirect stdout to a file

佐手、 提交于 2020-12-12 04:40:31
问题 I'd like to send the stdout to a logfile with a datestamp and location for each printer. On Error resume Next Dim objNetwork, StdIn, StdOut 'Initialize the printer connections object Set objNetwork = CreateObject("WScript.Network") Set StdIn = WScript.StdIn Set StdOut = WScript.StdOut 'Connect each printer objNetwork.AddWindowsPrinterConnection "\\server\pr01" objNetwork.AddWindowsPrinterConnection "\\server\pr02" objNetwork.AddWindowsPrinterConnection "\\server\pr03" 'Remove old printers

How to insert and resize an image in Word?

浪尽此生 提交于 2020-12-11 08:59:48
问题 I have written a VBScript to automate the creation of a Word document. I'm using the following code to insert an image, but I can't seem to find a way to then resize it. objSelection.InlineShapes.AddPicture("C:\test.jpg") 回答1: The AddPicture method returns a handle to the inserted object, so you could do something like this: Set pic = objSelection.InlineShapes.AddPicture("C:\test.jpg") pic.Height = 100 pic.Width = 200 来源: https://stackoverflow.com/questions/28194878/how-to-insert-and-resize

insert VBS variable within a single-quoted WMI query

谁都会走 提交于 2020-12-06 15:06:33
问题 I am really frustrated by the snippet below: Dim objFSO, varSrc, varDest, varExt Set objFSO = CreateObject("Scripting.FileSystemObject") varSrc = WScript.Arguments(0) varDest = WScript.Arguments(1) varExt = WScript.Arguments(2) If objFSO.FolderExists(varSrc) Then WScript.Echo varSrc strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM _

insert VBS variable within a single-quoted WMI query

不问归期 提交于 2020-12-06 15:03:32
问题 I am really frustrated by the snippet below: Dim objFSO, varSrc, varDest, varExt Set objFSO = CreateObject("Scripting.FileSystemObject") varSrc = WScript.Arguments(0) varDest = WScript.Arguments(1) varExt = WScript.Arguments(2) If objFSO.FolderExists(varSrc) Then WScript.Echo varSrc strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM _

VBS to split one column in two columns

匆匆过客 提交于 2020-12-06 11:50:00
问题 Let's say for example, i have one column filled with names, each name in one cell. First_Name_1 Last_Name_1 First_Name_2 Last_Name_2 First_Name_3 Last_Name_4 First name and last name are separated by space. How can i split this column in two columns, using Visual Basic Script so that i will have First_Name in one column and Last_name in a column next to it? Already tried this code, but can't manage to make it work. objExcel.ActiveSheet.Columns(4).Select Do Until IsEmpty(ActiveCell) 'Search

How to list all WMI classes having methods using VBScript?

。_饼干妹妹 提交于 2020-12-06 04:23:25
问题 Using VBScript, how can I list all WMI classes that have methods? 回答1: Run a SELECT schema query to get a list of all classes in a namespace, and then check each class's Methods_.Count: strComputer = "." strNamespace = "root\cimv2" Set oWMI = GetObject("winmgmts:\\" & strComputer & "\" & strNamespace) Set colClasses = oWMI.ExecQuery("SELECT * FROM meta_class") For Each oClass in colClasses If oClass.Methods_.Count > 0 Then WScript.Echo oClass.Path_.Class End If Next You may want to limit the

How does vbscript filesystemobject encode characters?

戏子无情 提交于 2020-12-04 03:50:06
问题 I have this vbscript code: Set fs = CreateObject("Scripting.FileSystemObject") Set ts = fs.OpenTextFile("tmp.txt", 2, True) for i = 128 to 255 s = chr(i) if lenb(s) <>2 then wscript.echo i wscript.quit end if ts.write s next ts.close On my system, each integer is converted to a double byte character: there are no numbers in that range that cannot be represented by a character, and no number requires more than 2 bytes. But when I look at the file, I find only 127 bytes. This answer: https:/