vbscript

With Powershell quickly growing in popularity, is there any reason to learn VBScript?

This is more a general question than anything. I know that VBScript and Powershell can do a lot of the same things and each does things the other can't, but I'm wondering if there's any reason to still learn VBScript or if efforts are best directed into learning Powershell. /matt ...

How to run .dll program?

Hi all, I want to use Run("someProgram.exe") command using BASIC language. This will open the 3rd application program. If that program running using .dll(not sure if it possible) not .exe, how can i code that? thanks in advance. ...

Problems with Recordset Filter

I'm having trouble with a filter on an ADO Recordset in legacy ASP Classic code, and I'm trying to understand if what I'm trying to do is not supported, or if I'm just doing it wrong. I have a recordset of Items, and they have a Status of 1 (active) or 0 (inactive), and an optional End_Date. In my administrative user interface, I have ...

VBScript! JScript! Wscript! ... oh my!

I need to write some scripts for WinXP to support some of the analysts here at Big Financial Corp. Please help me decide which type of windows scripting best fits my needs. My needs seem pretty simple (to me anyway) run on WinXP Pro SP2 (version 2002) not require my users to install anything (so Powershell is out. Likewise Perl, Pyth...

VBScript automate right click-[closed]

I want to automate simulation of a right click to open the context menu. Once the menu is open, select the selected action/shortcut available. I know how to open: WshShell.SendKeys("+{F10}"); Or using the AutoIt automation language (BASIC like): ;--on right click event MouseClick("right") $count = 1 Do Send("{D...

Regular expression for removing quotes from quoted numbers in a string

Let's say I have a bunch of text like this (simplified example, but you get the idea): INSERT stuff(a,b,c) VALUES('1','a','1'); INSERT stuff(a,b,c) VALUES('2','b','1'); INSERT stuff(a,b,c) VALUES('3','c','2'); INSERT stuff(a,b,c) VALUES('4','d','2'); INSERT stuff(a,b,c) VALUES('5','e','3'); INSERT stuff(a,b,c) VA...

How to select files within a folder?

I want to came out with a program which can open folder by reading the path from textfile. When open, the code will check if there is files inside the folder. for the first file, do some calling function, it will keep doing until the last file available in the folder. for example, if the folder A content 3 files, 1st.doc, 2nd.txt, 3rd....

Installing an exe file -VBSCript

Hi, I use the following command to run a exe file which is in the network drive through a vbscript wsh.Run """\lonmsc01\apps$\EWebEditPro\Version 4\ewebeditproclient4.exe""" This installation pops up with dialog boxes to choose the setup type As Resintall or Remove and proceeds on by clicking on Next to finish the set up. Is there an...

VBScript : checking if the user input is an integer

Within a VBScript, I need to make sure the user inputs a integer. Here is what I have now : WScript.Echo "Enter an integer number : " Number = WScript.StdIn.ReadLine If IsNumeric(Number) Then ' Here, it still could be an integer or a floating point number If CLng(Number) Then WScript.Echo "Integer" Else WScrip...

Deleting (near) Duplicate Files

What's the best scripted way to delete (near) duplicate files based on filespec in Windows (XP in this case)? I am thinking of RegEX and some VB Script but if there is a better way... Examples include filenames that slighlty differ in name either with one or two (known) extra characters at the end or beggining but are identical in size,...

VBScript to Write a Macro within an Excel file

Is it possible for the VBScript to write a Macro within the excel file when it is generated that would be able to run whenever the file is opened? Ive got a VBScript to auto generate an excel file and some data within it, this runs once and generates the file with all the data/sorts etc. What I need is to have some interactivity that w...

ByRef and ByVal in VBScript

I'm facing something weird in VBScript. When writing a procedure where I want the parameter to be passed by reference, the way of calling this procedure changes the way the parameter is passed ! Here is an example : Sub IncrementByRef(ByRef Value) Value = Value + 1 End Sub Sub IncrementByVal(ByVal Value) Value = Value + 1 End Su...

ASP and ADO error: No value given for one or more required parameters

Language is vbscript and classic ASP. The following SQL works when values are hard coded in the sql statement: sql = "UPDATE STORE2_ITEM SET sku = 'abcd' WHERE id = 224 and host_id = 1" What I'm trying to do is add parameters so I replaced the field1 assignment with the following: sql = "UPDATE STORE2_ITEM SET sku = ? WHERE id = 224...

Finding a UNC Path on another server?

Hi, I'm need of some way of finding the UNC Path of a share via a script or command line or even a custom created program. I'm trying to automate deletion of users and the setup is a bit complicated. Home folders are set up like this: We create a folder on a Disk on a fileserver. When this folder is created, a share is automatically cr...

How can I script copying an Access table from one mdb to another?

Hi all, I've inherited a setup that utilizes Access 97 databases. I need to copy a table from one main mdb to multiple others to prep them for use. The source mdb and source table are mostly static, the destination mdbs vary widely. So, I have: source.mdb contains table A destination.mdb contains tables 1, 2, and 3 I need to end up w...

VBScript - image to binary

Hi to all, i'm not a VB programmer but i need a vbscript that convert image file (from local disk) to be converted to binary data and the passed to webservice. I realize how to pass data to webservice but i can't find how to convert the image file to binary data. I spend a lot of time to find some kind of solution but with no luck. Can ...

I found this Reboot Vista.vbs script. Can you help with it ?

Hi guys. Found this Reboot Vista.vbs script on a number of forums. Seems like the whole post ( text including the code ) was posted on many forums. So I don't know who the original author is. Heres the code here: Option Explicit On Error Resume Next Dim Wsh, Time1, Time2, Result, PathFile, MsgResult, MsgA, AppName, KeyA, KeyB, TimeDiff ...

Regex challenge: Match phrase only if outside of an <a href> tag

I am working on improving our glossary functionality in a custom CMS that is running with classic ASP (ASP 3.0) on IIS with VBScript code. I am stumped on a regex challenge I cannot solve. Here is the current code: If InStr(ART_ArticleBody, "href") = False then sql="SELECT URL, Term, RegX FROM GLOSSARYDB;" Set rsGlossary = S...

VBScript building a parametrized query

Is it possible to build a VBscript parametrized query without knowing the names, types or number of arguments beforehand? I'm trying to do this: set cmd = Server.CreateObject("ADODB.Command") cmd.ActiveConnection = cn cmd.commandText = proc cmd.commandType = 4 cmd.Parameters.Refresh For i = 0 To UBound(params)...

How do you catch the VBScript runtime error: "Object required: 'Session' -- Developing vbs script for MSI, want to develop on cmd line where Session isn't defined.

Writing a script for a custom msi installer action. When my script is invoked by an Installer you can get Installer properties via Session.Property("PropName") If you don't invoke via installer you get a runtime exception. I want to make my script so I can develop and debug w/o the Installer so how do I catch this error? I want to do...