vbscript

ExcelADO - Using Range to fetch data from excel using VBScript

Given the advantages of ExcelADO as described here I have decided to use Excel ADO for QTP Automation. So here is the code which I used - 'Open the ADO connection to the Excel workbook Dim oConn Set oConn = CreateObject("ADODB.Connection") oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=D:\Mine\QTP\Book1.xls;"...

Problem creating simple "windows script components" on Windows 7.

Hi folks, I'm trying to get a Windows Script Component working on and x64 development machine. Works fine on x32 bit. But can't seem to get it running, I have the same problem with both JScript and VBScript. Here's the most simple wsc component possible. All that it does it pop up "Hello" in a message box. If you save the snippit below ...

Enabling all IE Trusted Sites Settings Through Registry/VBS

I have started a VBS to change all the Internet Explorer settings in Trusted Sites to enable and have had luck seeing the actual value change from whatever is was to 0 to indicate enabled IN THE REGISTRY. Problem is when I open IE settings none of the radio buttons have changed to indicate this change. Does anyone know where I went wrong...

Can you do classes in vbscript and ASP?

Is there anyway to do something like classes in vbscript. I ain't so good in classic ASP. Or does anybody have a C# vbscript conversion FAQ. My problem is that I must consume a webservice in classic ASP and the returntype is an array of a class. In asp.net with C# it's a piece of cake, because I know how to do it, but how do you do it i...

Why does a task in VBA get executed before an earlier one has finished?

As VBA-novice I'm having trouble understanding some VBA behaviour. I got the following code, which reads rows from a db into an activex control, and thereafter tries to put these values into an array. the vxdata1 activex is proprietary, no insight there - but basicly it cares for the ADO connection, executing of an SQL command and putti...

script to pull info from windows Drive

Hi All, I need a script that could ran and pull information from any drive on a windows operating system (Server 2003), listing all files and folders which contain the following fields: Full file path (e.g. C:\Documents and Settings\user\My Documents\testPage.doc) File type (e.g. word document, spreadsheet, database etc) Size When Cr...

How do I escape a semicolon in VB script?

I have a vbscript file that is reading a file and sending each line to a terminal program. When it comes to a semicolon in the middle of the string, it splits the semicolon at the string. I have been using this code for quite sometime with other strings with no problems. There is one string per line in the file the script is reading....

Vbscript. Variable looses its content?

...

XML in Classic ASP Vbscript

I am back to asp with XML manupulation. Initial file: <?xml version="1.0" ?> <root> <sport/> </root> this is my function Public Function DefinitFunction( x,z) Dim text Dim Root Dim NodeList text = "<Definition>" ---<x> </x> <z> </z> --</Definition> " text = text & "<x><![CDATA["&x&"]]> </x>" text = text & "<z> </z...

Folder Locking with vbscript

I am stuck in the following script,Please Help ' Discover Current Drive Path curDrv = objFSO.GetParentFolderName(WScript.ScriptFullName) 'Drive Path ulpath = curdrv & "\Locker" propath = curdrv & "\Control_Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" passFile = curdrv & "\pass.txt" If objFSO.FolderExists (propath) Then call ...

VBScript to detect an open messagebox and close it

Hi. I'm looking for a way to detect and close an open system messagebox with VBScript. Using the following script, I can bring the message to foreground and close it: set WshShell = WScript.CreateObject("WScript.Shell") WshShell.AppActive "System Settings Change" WshShell.SendKeys "%N" The Question: I need a way to detect if a messa...

How to parse XML in ASP/vbscript?

I have a result string with the following structure <items> <item> <id> I must iterate through down to id and I have some other tags there also. I really don't know how to do it in vbscript. And I would like to have all id:s returned in an array. Is there not really a method like this: Dim doc Dim thumbArray Set doc ...

parse utf code in vbscript

Is there a way to parse utf codes in vbscript? What I'd like to do is replace all codes like "\u00f1" in a string for its corresponding character. ...

how to call RASdail functions in VBscript

hi, i want get information about pppoe connection and i m thinking to do it with VBScript ( if possible ) so what i want to do is Get the information of connection if connected then this thing if not then this thing wait for 2 mins and then dial connection i know there is a method to ping a server to know the connection state bu...

I want a generic function in VB Script which should help everyone where someone want use date in specific format.

My application server is in London so date format is freeze to format DD-MMM-YYYY (e.g. today’s date 16-Feb-2010) we have written VBScript code to enter the date in same format. But code fails in LN machine due to LN PC date format is dd/MM/yyyy whether NY and India PC format is MM/dd/yyyy where code works fine. Here I want one generic ...

VBS Script Help.

I managed to get this code from you guys here, thanks so much with a collegue of mine, I ran this code a few times and it seems to work but stops after a while due to protected files such as system files, "Permission Denied" and then the script just stops, is there a way to modify the code below so that it can handle such protected files...

VBS - Get Default Printer

Using the Wscript.Network object shown below, is there an easy way to retrieve the default printer on a machine? I know how to set the default printer, but I'm looking to get the current default printer name. I have a mixture of Windows 2000, XP, and 7 clients and don't want to use WMI for that reason. Set objNetwork = CreateObject("W...

How do I do a loop in Visual Basic

I have programmed in C, Pascal, GWBasic, TCL, Perl, Lisp, but Visual Basic is too advanced for me. FOR j = 1 TO 31 output_to_webpage "<p>Counter is " + j + "</p>" myDay = "" + j IF j < 10 THEN myDay = "0" + j MyStr = MyStr + ",j" NEXT The loop never appears to happen. Although if I comment out any references to the loop vari...

Can you use constants in VbScript switch statements?

Id expect this to work (below) If iTestVar is 1, I'd expect DoStuff() to be fired. However it always falls into the else. I have researched const in the past and found they can only be defined outside of classes. The select statement is inside the class. 'This is defined outside of the class (vbscript won't allow const inside c...

VBScript Issue Help Required.

I need a script that can run and pull information from any drive on a Windows operating system (Windows Server 2003), listing all files and folders which contain the following fields: The server is quite big and is within our domain. The required information is: Full file path (e.g. C:\Documents and Settings\user\My Documents\testPage...