vbscript

Search and Replace using Backrefrence in vbscript for excel 2007

Hi, I'm using excel 2007 and i'm adding a macro that looks something like this : Function S(Value As String, Pattern As String, ReplaceWith As String, Optional IgnoreCase As Boolean = False) Dim r As New VBScript_RegExp_55.RegExp r.Pattern = Pattern r.IgnoreCase = IgnoreCase r.Global = True S = r.Replace(Value, R...

How to Check whether the current logged in user is member of Administrators group?

Hi, How to Check whether the current logged in user is member of Administrators group or not? in vbscript. Thanks, ...

How do I debug a stand-alone VBScript script?

I have a VBScript script that takes 2 command-line arguments and does some validation. I need to debug this to see how the program is getting executed. I was trying to paste this into Excel (using VBA). However there are some constructs like Const, etc. that are not being supported, plus certain validations like taking the command-line a...

VB GUI Interface to run VBS Script.

Hi Folks I have a VBS script which I need to run on a monthly basis which captures file information suhc as file Name, Type, Date Modified and more. When I processes each file it saves it all onto a CSV file so that I can process it on Excel. To run the script I setup a batch file .bat The issue is I need a GUI interface of some sort ...

How to read the user email address in HP QC Script Editor?

Inside the HP Quality Center Scripting Editor, I can access current user info (like user name or full name) with the "user" object. How do I access the current user E-Mail address property? ...

VBscsript "SET" question

Hi, I know set in VBScript is used for assigning the object reference to the variable. I would like to only understand why its neccessary: Set fso = CreateObject("Scripting.FileSystemObject") what about: dim fso fso = CreateObject("Scripting.FileSystemObject") //would not it create the object directly and assign to the var...

Permission Denied when running VBScript

Hi Folks. I have a vbs script which captures file information and then exports it to a csv file. I need to run the script on main drives such as C:\, E:\, I:\ and more, but each time I run for the main directory I get "Permission Denied" when I try to run it for a subfolder example C:\Program Files it works fine. I have tested this on d...

How can I assert in VBScript scripts?

What is a good way to use asserts in VBScript scripts? Is there built-in functionality for it or will it have to be emulated? What is best practice? One application is to test for objects being Nothing during development. ...

How do I determine if a path is relative or absolute with VB Scripting Host

Hello How do I determine if a path is relative or absolute in Visual Basic Script. In VBA, I'd call the Win32 Api function PathIsRelative Private Declare Function PathIsRelative Lib "shlwapi" _ Alias "PathIsRelativeA" _ (ByVal pszPath As String) As Long However, it's not possible to call into a DLL from VBS, so I cannot use t...

VBScript Out of String space

I got the following code to capture information for files on a specified drive, I ran the script againts a 600 GB hard drive on one of our servers and after a while I get the error Out of String space; "Join". Line 34, Char 2 For this code, file script.vbs: Option Explicit Dim objFS, objFld Dim objArgs Dim strFolder, strDest...

Relitve path for MSXML2.ServerXMLHTTP.6.0 not working

I have this code which works but I need to stop using http in the string as it sometimes is on a https servers. Hence my wish to change it to a relative path e.g. Url = "../../path/to/file.asp" but when make the change to this code we get this error. msxml6.dll error '80072ee6' System error: -2147012890. I am sure I missing somethin...

Reading multiple recordsets

I have a Stored proc which returns 6 select statement results. I'm trying to use one record set to execute sp and get records for each select statement but i get 0 or empty records when i read them, How can i query record set with multiple select statements from stored procedure? ex: Set rs = Server.CreateObject("ADODB.Recor...

Is it any way to test from vbscript if a folder is a symbolic link?

Hello. I have some visual basic script code in my installer and i need to test that specific folder is a symbolic link or a normal folder. Is it any way to perform such task in vbscript? ...

or operator in vbscript

Does vbscript support or operator? I want to do following code in vbscript, please help me if a="address1" or b = "address2" then Response.Redirect("www.site.com") endif ...

Import WinAPI Function in *.VBS File

Hi there, Using visual basic in say Excel, I am able to declare WinAPI functions using the DECLARE keyword - e.g. Declare Function SetLocaleInfo Lib "kernel32" Alias "SetLocaleInfoA" ( _ ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String ) As Boolean However when using this syntax in a *.VBS file - it fa...

How can I run this VB Script from a local HTML file?

I apologize in advance if this problem is more sysadmin than programming, but since my actual problem involves getting the browser to run my code I figured I'd post it here first. I am using IE's Content Advisor to create a white list of websites for specific computers. I would like the home page of these computers to contain a list of...

ASP : Call ACCESS procedure with accent

Hello, I'm stuck with an application where I have a stored procedure with an accent. Set cmdStoredQuery = Server.CreateObject("ADODB.Command") cmdStoredQuery.ActiveConnection = Conn cmdStoredQuery.CommandText = "S_Réseau" Set RS = server.createobject("ADODB.Recordset") Set RS = cmdStoredQuery.Execute When I execute it, it says : E...

Anyone knows a good vbscript vbs IDE

I'm looking for a free or opensource IDE for vbscript... i have Visual Studio 2008, but it doesn't support vbs. thanks ...

Turn off Always Prompt For Logon Credentials in Outlook 2007 using vbscript

Is it possible to turn off "Always Prompt For Logon Credentials" in Outlook 2007 using vbscript? ...

Script for changing fonts in a Word document

I have a Word 2007 file and I want to change all usage of the Courier New font into a Lucida Console font. I need a script that find all words formatted in that font and change it to the new font. How can I do that? ...