vbscript

How do I read 64-bit Registry values from VBScript running as a an msi post-installation task?

I need to read the location of the Temporary ASP.NET Files folder from VBScript as part of a post-installation task in an installer created using a Visual Studio 2008 deployment project. I thought I would do something like this: Set oShell = CreateObject("Wscript.Shell") strPath = oShell.RegRead("HKLM\SOFTWARE\Microsoft\ASP.NET\2.0.507...

Binding to AD Objects (with varying locations)

We are undergoing a migration from several domains into a single domain. As part of that process, user accounts are being moved around the various ADs a fair bit. This has resulted in some scripts breaking because they are trying to get the User objects from a specific location in AD. How would I amend the following to not be AD locat...

Unable to connect to SQL2005 using VBScript

I have the following VBScript, which is supposed to connect to a SQL Server 2005 database. But, my connection is failing. Why? Set dbConnection = CreateObject("ADODB.Connection") dbConnString = "Provider=SQLOLEDB.1;Data Source=srv\test1;" & _ "Initial Catalog=tset_DB;user id ='abc';password='abc'" 'Open the connection d...

Excel sheet doubts in vbscripting

Hi all, I am creating an excel file as shown below strFileName = "c:\test.xls" Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True Set objWorkbook = objExcel.Workbooks.Add() objWorkbook.SaveAs(strFileName) objExcel.Quit Now after some data manipu...

How to check for registry value using VbScript

Hi, How can I check for registry value using VbScript? Thanks ...

Response.redirect in vbscript

Can you tell me a vbscript for doing an action just like response.redirect command doing in asp.net.I need to got to one page from another page ...

Copy Update Create VBScript

Please help me to acheive the following using VBScript 1.Messagebox with three tabs Copy,Update,Cancel and displaying "Welcome to the AVG definition fies copier/updater module.Click on Copy to copy files or Update to update definition files. 2.If copy selected,the drive letter from where the script is run(usb drive) stored as var...

Hosting WSH (VBScript, JavaScript) in your delphi application?

I'm looking to execute user supplied scripts from my Delphi application. Is it possible to host the Windows Script Host engine in my application and supply it with scripts to execute? Or, is there a better way to approach this problem? P.S I'm not looking for third-party components. ...

Now() Accuracy in VBScript

Now() in VBScript appears to return time in 10,000,000th of a second precision when called as CDbl(Now()). In attempting to use this to write a more accurate implementation of now which returns CIM_DATETIME format I found that in VBScript, despite being particularly precise, is not very accurate with the time only updating once per secon...

How to call IMsRdpClient5::GetErrorDescription method from VBScript

I'm using the RDP ActiveX control in a web page to open remote desktop connections. Here is the code I using but it doesn't work, it gets stuck when calling the GetErrorDescription method: <script language="vbscript"> sub MsRdpClient_OnDisconnected(disconnectCode) dim error_message extendedDiscReason = MsRdpClient.Ext...

VBScript "Type Mismatch" issue with "[in, out] BSTR * " parameter

Hi, I'm working with third-party COM object that has some of its methods passing values back as BSTR pointer. Since VBscript supports only Variant type attempts to use in a way like Object.Method(sMyString) reasonably end with "Type mismatch" error. I suspect this error is generated by the COM object itself rather then VBscript interp...

How to avoid re-execute the query on a MoveFirst

I have a query in a ASP page. The record set that I obtein must be printed in 3 different tables, after some conditions. So, for avoid extecuting 3 times almost the same query, I decided to search the recordset for the results I need...so I need to make a RS.MoveFirst two times. But...when I analyzed with SQL Profiler, I saw that MoveFir...

Custom analysis rules for Microsoft Source Code Analyzer for SQL Injection (MSSCASI_ASP)?

Microsoft Source Code Analyzer for SQL Injection (MSSCASI_ASP) is a static code analyzer for classic ASP VBScript code that can help identify pages that might have a SQL injection vulnerability. It seems like a nice tool, but now that I've found Microsoft Code Analysis Tool for .Net (CAT.NET) -- a static analyzer designed to help find SQ...

Calendar UI widget for wscript/vbscript

I'm a newbie to windows scripting. Is there a Calendar UI widget which I can use from wsh to get user input? I basically need to get a Date from the user. ...

File Folder copy

Below is the VBScript code. If the file/s or folder exist I get scripting error, "File already exists". How to fix that? How to create folder only if it does not exist and copy files only that are new or do not exist in source path? How to insert the username (Point 1) after "Welcome" and at (Poin 3) instead of user cancelled? Can the ...

Can I run a VBScript script from inside Visual Studio 2008?

I'm writing pop-up's for a website (please don't get angry. It's an internal application that shows energy usage for different buildings and the specification is to alert the users every time they log on) and I have a VBScript script that will run at the end of the a Windows user's logon script. Is there a command to run the script from...

Copy a file from one folder to another using vbscripting

Can anyone please tell me how to copy a file from one folder to another using vbscripting I had tried this below one from the information provide in the internet. dim filesys set filesys=CreateObject("Scripting.FileSystemObject") If filesys.FileExists("c:\sourcefolder\anyfile.txt") Then filesys.CopyFile "c:\sourcefolder\anyfile.txt",...

How to read values from a word doc file using VBScript

Can anyone tell me how to read values from a word.doc file using VBScript. I had given a sample.doc file below. Parameters Default Values ----------------------------------------------------- No of values 8192 Sampling Frequency 12800 Frequency Hop 2000 No of times 2 The above one is...

Auto Correcting Excel Spreadsheets for Idiots

I have a client who is incapable of formatting spreadsheets properly. I've asked them 10 times over to follow a sensible guideline (As in FORMAT THE COLUMNS WITH THE CORRECT DATATYPE) but in their lack of intelligence or professionalism or both, they just can't /won't do it. I have an ODBC connection set up for the spreadsheets and pull...

Exit a while loop in vbscripts

Hi, Can anyone please tell me if there is anyway by which i can exit from a while loop when a certain condition is true when i tried this below,i get some errors num = 0 while(num<10) if(status = "Fail") then exit while end if num = num+1 wend I get some errors.Is there any work...