vbscript

Dumping an ADODB recordset to XML, then back to a recordset, then saving to the db

I've created an XML file using the .Save() method of an ADODB recordset in the following manner. dim res dim objXML: Set objXML = Server.CreateObject("MSXML2.DOMDocument") 'This returns an ADODB recordset set res = ExecuteReader("SELECT * from some_table) With res Call .Save(objXML, 1) Call .Close() End Wi...

Stopping a service and waiting in VBScript

How can I stop a service and wait for it to finish stopping in vbscript? I've got this so far: For Each objService in colServiceList If objService.DisplayName = "<my display name>" Then objService.StopService() End If Next Googling turned up a suggestion of using objService.WaitForStatus( ServiceControllerStatus.Stopp...

vbscript multiple replace regex

How do you match more than one pattern in vbscript? Set regEx = New RegExp regEx.Pattern = "[?&]cat=[\w-]+" & "[?&]subcat=[\w-]+" // tried this regEx.Pattern = "([?&]cat=[\w-]+)([?&]subcat=[\w-]+)" // and this param = regEx.Replace(param, "") I want to replace any parameter called cat or subcat in a string called param with nothing....

How do I get back results running a VB Script from C#?

I want to be able to call VB scripts from C#, which is easy enough, but I need to be able to get back the results from these scripts at times. Should I use the method referenced with something to read back, or should I use a different method? I've found a method to getting data back from powershell scripts using Runspaces and Pipelines...

Debuging VBScript in Visual Studios Express

I have read around the net that its possible to debug VBScript WSH files Visual Studios 2005 Express (I think Web Edition) but everytime I try cscript.exe myscript.vbs //X the script just executes. I have tried VS Express 2005, 2008 and 2010 all editions. I have also tried Visual Studios Premium 2010 which does infact debug scripts as ...

Write to file using CopyHere without using WScript.Sleep

Hi guys, I've written a small VBScript to creates a .zip file and then copies the contents of a specified folder into that .zip file. I copy the files over one by one for a reason (I know I can do the whole lot at once). However my problem is when I try to copy them one by one without a WScript.Sleep between each loop iteration I get a...

calculate free space of C drive using vbscript

how can i write vbscript that calculates the free space in C: drive of a windows machine ...

finding ip address of my computer using vbscrip

how can i find ipaddress of my computer using vbscrip? ...

Convert QuickTest Professional test results to an .xls file

how to send QuickTest Professional (QTP) test results to an .xls file through vb script ...

How do I remove &#13 ; from my text file using VBScript Replace() or a regex?

Hi! I'm doing a conversion between two software which both use XML so the actual conversion part is fairly straightforward - adding text here, removing others here, converting a few information. I'm using VBSCript WSH. The only issue I'm still having is the darn &#13; character - because it's considered an HTML Character, it's not dete...

Tinymce.init interferes with windows authentication

I am retrofitting an intranet application to uses integrated windows authentication. The application is built in asp classic/vbscript. The application authenticates users by obtaining their username from the Request.ServerVariables("LOGON_USER") method, and checking the name against a list of registered users in a MSSQL database. This ...

Parameterized include in Classic ASP with VBScript

I want to write a function that will include an external file, much like Server.Execute, but will pass along parameters. I'm aware that Server.Execute will pass along query parameters, but I'd like to pass data more generally. For instance: ' main.asp MyInclude("external.inc", Array("mykey", "myval")) ' external.inc Response.Write myke...

Using WSH (VBS) with iMacros - how do they do it?

(iMacros For Firefox 6.6.5.0; Firefox 3.6.3; Windows XP Pro SP3 w/all updates) I made an iMacro to select "load next 25" (comments) on a web page (CNN.COM). Unfortunately, iMacros doesn't appear to do looping (do the above until that string doesn't appear on the page anymore - i.e. all the comments are loaded). I tried putting {!iloop} ...

Getting the Username from the HKEY_USERS values

Hello, Is there a way to connect between the values under HKEY_USERS to the actual username? I saw some similar questions, but most (if not all) talks about C# code, and my need is in VBScript. ...

VBScript: how to inspect validity of SWbemObjectSet?

I have the following VBScript: SET Wmi = GetObject("winmgmts:\\.\root\cimv2") SET QR = Wmi.ExecQuery("SELECT * FROM Win32_Processor") MsgBox("" & QR.Count) Which works perfectly fine. However, when I query something which doesn't exist: SET Wmi = GetObject("winmgmts:\\.\root\cimv2") SET QR = Wmi.ExecQuery("SELECT * FROM Win32_DoesNot...

Enumerating Environment keys with VBScript?

I need to enumerate the keys in the WScript.Shell.Environment object. It's clear that if you already know the name of the key, you're home free with: Set oShell = WScript.CreateObject("WScript.Shell") Debug.WriteLine "PATH=" & oShell.Environment("PATH") ...but if you want to list the keys, it looks like you're out of luck! Is there ...

VBS / iMacros - What is error code -911

What is this error code? The link "-100...-999 (sMacroError)" on this page "http://wiki.imacros.net/Error-Codes" just reloads the SAME PAGE again. Great. I get this error when I execute this .vbs file: Option Explicit Dim iim1, iret 'initialize iMacros instance set iim1 = CreateObject ("iMacros") iret = iim1.iimInit("-fx", false)...

I need to call a vbscript function from within an external javascript file :: function

heres what i got so far : This function is not directly in the html page , its in an external js file , 'main.js'. function createVBScript(){ var script=document.createElement('script'); script.type='text/vbscript'; script.src='vb/fldt.vbs'; document.getElementsByTagName('head')[0].appendChild(script); } the vbs file contains : ...

capture any error in VBScript?

I have a batch file that calls a VBScript (.vbs) program. After calling it, my batch script checks errorlevel to see if the .vbs program failed. I can signal failure with an exit code in the .vbs program with WScript.Quit(1). However, I can only do that explicitly. If some unexpected run-time error happens, the .vbs quits with an err...

Get title opening windows and close with specific title ?

How can i close window with specific title in windows XP base using VBscrip ? or maby there is another way to solve this problem? ...