vbscript

vb script problems within asp

I'm trying to get this code working within an asp page. when the user clicks an OnClick button, it will take them to this page which will create a file to store that user's username and the time they executed the code. So far, when this code runs, it will create the "userinfo.flag" file but it does not capture the user's data. Basically,...

Unable to access Excel's Application.ComAddIns property if there are no AddIns installed

This code snipped for the Windows Scripting Host displays the number of COM-AddIns currently installed into Excel. It works fine except for when there are no COM-AddIns installed. I believe it should output a "0", but instead it raises an exception (code 800A03EC). Does anyone know why? test.vbs Set objExcel = CreateObject("Excel.App...

Problem with 2 command in 1 vbs

Hello, I have a little problem with a simple vbScript. The script has to run 2 action one after the other. Option Explicit Dim WshShell Dim Yesterday Dim resultat Dim commande Dim Jour Set WshShell = WScript.CreateObject("WScript.Shell") Yesterday = DateAdd("d", -2, Date()) resultat = "00001" resultat = resultat & Right(Year(Yester...

Detect Plugins in Internet Explorer without Instantiating the Object

Normally when you use VBScript or JavaScript to CreateObject to detect a plug-in, the user gets the somewhat "jarring" security exception. What are some good ways to detect IE browser plugins without actually instantiating the object? ...

Accessing Employee ID via LDAP in a Classic ASP/VBScript application

I've got an older ASP/VBScript app that I'm maintaining/upgrading and its currently using the older/depreciated means of gathering profile information - like below: strNTUser = Request.ServerVariables("AUTH_USER") strNTUser = replace(strNTUser, "\", "/") Set strNTUserInfo = GetObject("WinNT://"+strNTUser) 'You get the idea' When all I...

Is there a good testing tool for web interfaces with support of VBScript?

I have to performs testing on an old legacy tools that's web based and make a huge use of VBScript, rather than JavaScript. So, yes, it's a IE-only tool. Usually, I tend to use WebTest to performs such testing, but it does not support VBScript, making it unusable in that case. So, is there a testing framework that support VBScript? (pl...

VB Script Text File Prepend

Anyone know how to quickly prepend (add two new lines of text) to the start of an existing text file using either VB Script or a Bat file? Most elegant solution gets the tick. ...

How can I make my application install scripts to bypass User Account Control in Server 2008?

I've written a bunch of VBScripts to install software (like SQL Server Express, WSUS etc.) on my Server 2003 boxes which has all been fine. I'm now adapting them to new Server 2008 boxes and they now won't run without bringing up the UAC prompt. I know this is normal behavior, but is there any way I can disable UAC, run my install stri...

How to run VBScript in Windows NT 4?

I have a VBScript which I am scheduling to run daily on many Windows servers. In Windows 2000 and 2003, the script worked fine as the two OS have csript.exe. However, in Windows NT 4, it does not seem to have this executable. Is there an alternative/option to run the VBScript in Windows NT 4? ...

How do I close Word (or other app) if an error occurs in a VBScript?

I wrote a VBScript app to open Word and Excel documents and search and replace blocks of text and various sections, pulling the new text from a plain text file. I purposely avoided any error checking, primarily because I couldn't figure it out at the time (and the script ran reliably anyway). Now months later on my local machine, I am in...

How to use VBScript in Powerdesigner ?

In Powerdesign would like to create a VBscript to rename/reform the following names in powerdesigner- Conceptural or Physical model Alternative/Unique Key Name: *UQ {table_name} {tablecolumnname}* /////// Example = UQ_Account_AccountNumber Relationship Name: FK{table_name}_{reference_table_name}_{reference_col...

return only Digits 0-9 from a String

I need a regular expression that I can use in VBScript and .NET that will return only the numbers that are found in a string. For Example any of the following "strings" should return only 1231231234 123 123 1234 (123) 123-1234 123-123-1234 (123)123-1234 123.123.1234 123 123 1234 1 2 3 1 2 3 1 2 3 4 This will be used in an email pa...

Should I build a recordset first or just insert the data?

I'm consuming a web service using a stand-alone VBScript. The web service returns to me a list of jobs, which I need to loop through and add to a SQL database. I can either Run through the nodelist, reading the data and actioning the SQL insert in the loop. or Run through the nodelist building a recordset, then run through the recor...

Intermittent "Division by zero" error in classic ASP pages. HELP!

This is a strange one. A web application which runs fine on Windows Server 2000, experiences intermittent errors on Windows Server 2003 R2. By intermittent, I mean myself and 2 testers can find the error within 5 minutes of navigating around the web application. The error is always "Division by zero" - 800a000b The most common line of ...

How to read from a text file using VBScript?

I am looking to see a simple way to read from and write to a text file using VBScript. I think this is an acceptable method for writing to a file. Dim f, Dim fso Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.CreateTextFile("C:\test.txt", True, True) f.WriteLine("Data to Add to file.") f.Close However, I wo...

Automate form Submission

How to automate the submission of html form, with random text values using vbscript? ...

How do I call a method in a custom ActiveX dll using java/vb script

I have created an ActiveX dll using VB6 and packaged it using the Package & Deployment Wizard which has resulted in a cab file and a demo HTML page. This ActiveX dll contains a simgle method that returns a string and accepts no arguments. The trouble I'm having is that when I call the method I always get a "Object does not support thi...

Accessing an activeX control via VBScript on a SharePoint page

I am using an activeX control for the PDF-XChange Viewer software. Their support team gave me the following code sample: <html> <head> <title>PDF-XChange Viewer ActiveX test...</title> <script language="VBScript"> Sub btnGetProperty_OnClick() PXCV.OpenDocument "/sandpit/appsheet/faxcentre2/Faxes/1234-56789-abc-123-3.pdf", 0...

Alternative to Application.LoadFromText for MS Access Queries

I am attempting to load from text files, queries into an MS Access Queries Collection using VBScript. I am using something like this: The code originated from Here. for each myFile in folder.Files objecttype = fso.GetExtensionName(myFile.Name) objectname = fso.GetBaseName(myFile.Name) WScript.Echo " " & objectname & " (" ...

How to use VBScript to return data from SQL Server 2005

Using a variety of sources I put together the following script ... Dim myStream, myConnection, myCommand Set myStream = CreateObject("ADODB.Stream") Set myConnection = CreateObject("ADODB.Connection") Set myCommand = CreateObject("ADODB.Command") ' myConnection.Open "Provider=SQLOLEDB;Integrated Security=SSPI;" & _ "Persist Security Inf...