vbscript

Word macro error messages

One of our clients has decided they need their document template macros changed and I am ~lucky~ enough to be given the job. The one thing I can't find out how to do is to customize error messages. For example an error message they get in a document is "Error! No table of figures entries found" I would like to change this to display so...

Convert Javacript code to VBScript code?

I have been given a task to convert code that is written in JavaScript over to VBScript. It is actually quite basic code and it is really just the syntax that needs to be converted. For example if (str == "string text") { foo = "foo"; } else { foo2 = "foo2"; } becomes If (str = "string text") Then foo = "foo" Else foo2...

Retrieving DLL Metadata from VBScript?

Using only VBScript (launched from Windows Scripting Host) can I pull the DLL metadata from kernel32.dll? Specifically, I'm looking for the version info and the architecture specified in the DLL header. Can this be done without any dependencies? ...

End win32 process vbscript

Hi there, I've got the following code to end a process, but I still receive an error code 2 (Access Denied). strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colProcessList = objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'MSSEARCH.exe'") For each objProcess in colProc...

How to pass object parameters in ActiveX events to script

Following on from this question here I have a custom ActiveX control which raises an event "BeforePageValidated" which has a parameter "args" which is an object which contains a boolean. The purpose of this is to allow the client to override the validation and force it fail by setting the boolean value to true. I can catch the event in...

Overriding CreateObject Function in VBScript

Need help to figure out how to overide the default CreateObject() function in VBScript with my own. Basically the same exact thing as this example in VB6: http://www.darinhiggins.com/2007/08/22/TheVB6CreateObjectFunction.aspx I just need to adapt this to work in VBScript. The only thing I cannot figure out is this line: VBA.CreateObj...

Vbscript detect whether UAC-elevated

I think the title says it all. How can my vbscript detect whether or not it is running in a UAC elevated context? I have no problem detecting the user, and seeing if the user is within the Administrators group. But this still doesn't answer the question of whether the process has elevated privs or not, when running under Vista or Window...

Launching a ClickOnce Deployed Windows application using VBScript

I have a ClickOnce deployed application I want to launch from VBScript, similar to launching Microsoft Word in the following example: Dim word Set word = CreateObject("Word.Application") word.Visible = True The problem is I don't know what parameter to pass into the CreateObject function to launch my application. Where would I find th...

How do I programmatically (in vbscript) change/set the tcp port for a site under IIS?

My programming environment includes scripts for setting up my autobuild on a clean machine. One step uses a vbscript to configure a website on IIS that is used to monitor the build. On a particular machine I will be running apache on port 80 for a separate task. I would like my vbscript to set the port to 8080 for the new site that it...

Favourite AJAX library for classic ASP?

Just wondering if there are any good server-side libraries for AJAX (prefer JSON rather then XML but anything is good) for classic ASP (VBScript)... Rather not reinvent the wheel if it's already working and debugged. Cheers, Gaspard EDIT: Server-side ASP VBScript... I have already seen many javascript client side libraries. ...

Exclusive File access to logfile with VBScript and Filesystemobject

Need help with this one. I have a VBS script that currently writes to a logfile. This script can be kicked off my multiple simultaneous processes so now I'm worried about concurreny. I'm currently using the FilesystemObject to open and write to this file. Does FSO support exclusive file access? Thanks in Advance ...

Classic ASP: Page text translated from SQL table, a faster way?

Using classic ASP VBScript, coupled to MS SQL Server, we have a function that takes 3 integers, page_id, heading_id, language_id it looks up the page heading in a translation table... This table contains roughly 10,000 rows... The heading column is nvarchar(1000) plus the 3 int columns meaning it's around 2KiB per row max... so my qu...

IIS on Windows XP

Hi, Is it possible to run more than one website on IIS 5.1 (Windows XP)? I'm able to create multiple websites through adminscripts in IIS, but only one website can be active at a time. Is there is any workaround, trick, or script for this limitation? Thanks, ...

Programatically raise user privileges

I have been maintaining an installation for a while but I am not really an expert. now I've been asked to come up with a solution for this: Our software is always sold together with a computer as it has to be run in a very controlled environment. The installer needs administrative privileges to be executed. So far we had two different u...

Editing the Registry with VBScript on Vista

A VBScript cannot edit the registry by default on Vista. How do I get elevation (even if the user has to do something when they run the script) so that the script can edit the registry? The error is: --------------------------- Windows Script Host --------------------------- Script: blah blah blah.vbs Line: 6 Char: 1 Error: Permi...

detect a 'Error: Object doesn't support this property or method'

The object I'm working on is instantiated in javascript, but used in VBSctipt. In one code path the variable M.DOM.IPt is defined and has a value, however, in the other it is not. I need to detect if it has been defined or not. I checked that M.DOM is defined and accessable in both code paths. Every test I have tried simply results in Er...

How to modify a spreadsheet without Excel using VBScript

I need to find a way to add a row to a spreadsheet using VBScript, on a pc that does not have Microsoft office installed. I have tried using a line like this [Set objExcel = CreateObject("Excel.Application")], but since Excel does not exist on the pc I cannot create this object. Is there a way to modify a spreadsheet without Excel? ...

Easiest way to call a Windows macro from Autohotkey (or VB)?

I have the following Macro I want to call from within an AutoHotkey script in order to set certain dates in my MonthCal object to be bold. http://msdn.microsoft.com/en-us/library/bb774722(VS.85).aspx How would I go about that? Note that it's possible the easiest way to do it is to write a simple VB script which uses the macro and cal...

How do I use WScript.Shell SendKeys to send Number Pad key strokes?

I am trying to use WScript.Shell SendKeys method to emulate sending a key press from the Number Pad. I have an application that I am writing automated testing for using QTP. It is a Web Browser based application and the input is into a Java App within the web page. The input only accepts key presses from the Number Pad and the Enter k...

Rename Virtual Directory in IIS?

Hi guys, How can I rename a Virtual Directory (Web Application) in IIS 6.0/7.0 using Vbscript? Thanks, ...