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,...
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...
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...
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?
...
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...
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...
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.
...
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...
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?
...
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...
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...
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...
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...
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 ...
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...
How to automate the submission of html form, with random text values using vbscript?
...
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...
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...
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 & " (" ...
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...