vbscript

creation of file using vbscript

i did the following vbscript code to write a text file called "level.txt" in C:\Documents and Settings\All Users\Application Data\secon\generator Const CommonAppData = &H23& Const PATH = "\secon\generator" Dim fso, MyFile Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(CommonAppData) Set objFolder...

VB + find file under current dir with fso.FileExists

hi all what’s wrong on the following syntax I want to verify if file.vb exist under currDir (currDir=C:\dir1\dir2) If (fso.FileExists(currDir\file.vb)) Then Wscript.Echo OK End If ...

Split a string according to a regexp in VBScript

Hi, I would like to split a string into an array according to a regular expression similar to what can be done with preg_split in PHP or VBScript Split function but with a regex in place of delimiter. Using VBScript Regexp object, I can execute a regex but it returns the matches (so I get a collection of my splitters... that's not what...

HTML with VBSscript write to table

Hello, I would like to click a button and have a VBScript called to write to a table's lower half eg: -------- |Top |------- |bottom (vbscript writes to here) -------- Is this possible? And how would I accomplish this? ...

Windows scripting to parse a HL7 file

I have a HUGE file with a lot of HL7 segments. It must be split into 1000 (or so ) smaller files. Since it has HL7 data, there is a pattern (logic) to go by. Each data chunk starts with "MSH|" and ends when next segment starts with "MSH|". The script must be windows (cmd) based or VBS as I cannot install any software on that machine. F...

Are there any VBScript libraries?

Are there any open source free VBScript libraries? I am doing a lot of windows administration and always find myself writing error prone code. Any help here? ...

Copy printers from 1 server to another

We're migrating a bunch of printers from server 2003 to server 2008. This involves building new server 2008 boxes and decommissioning the older 2003 ones. There are alot of servers and a lot of printers. Are there ways to write a vb script or maybe a .net app to copy network printers from one server to another? ...

Strange problem with nvarchar(max) fields and Classic ASP

I'm working on a Classic ASP (VBScript) site that's running on a Windows 2008 server with IIS7 and hitting a SQL Server 2008 database and I'm seeing some strange behavior that seems to be specific to fields that are of type nvarchar(max). I have this simple bit of code that loops over some query results and tries to print out the title ...

SSRS experssion building

how to evalute one condition for "Negative" and other condition for "Negative Invalid" because iif not checking for both string, so if it reads Negative it jumps to result without checking that it is Negative or Negative Invalid ...

WMI VBScript vs C#

Hey all, I'm trying to get info about installed software on local computers (one is Windows 7 and other XP SP3) and I'm able to do it with VBScript, but not with C#. Here is the VBScript code: strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\cimv2"...

Reading and writing value from a textfile by using vbscript code

i have a variable named 'data' i need to write in to a textfile named "listfile.txt".Can you tell me the vbscript code to do that..And i need vbscript code for reading value from textfile "listfile.txt" also ...

Deleting email automatically

Hey Guys, The Problem: I'm looking for a way to create a program that visits an email host site and log in with a specific credentials and deletes all message at the Inbox and clears the Trash folder. Background: I have an email with my domain and that email is hosted on some ISP server. However I have enabled auto-forward all my ema...

Running a vbs file via a scheduled task on Server 2003

Hey, guys. I've been working on modifying an existing vbscript. The wierd part is that when I run the script manually, it works fine. But as soon as I try to run it as a scheduled task, it reports as complete, but doesn't actually do anything. After much troubleshooting, I think I tracked it down to the original CreateObject. Here...

Sending variables from C# to VBScript

Hello, is it possible to send variables from C# to a VBScript file? Then send variables back to C# after the script is executed. Thank you ...

vbscript can be used for public website?

hi all, in fact i have piece of vbscript and i want to use it on my website, i beleive that vbscript can only work on IE but my question Vbscript can work for people that not on my intranet? for example wwww.stackoverflow.com has a function written in vbscript , this is mean this function can excecuted for its visitors and without any l...

How to over write and write in to a textfile by using Vbscript

i created a text file "list.txt" in commonapplicationdatafolder by using the following VBscript.i am displaying some values from a variable(strlist) by writing in to textfile. Const Value = &H23& Const PATH = "\Cape\ibs" Dim fso ' File System Object Dim spFile ' Text File object to write Dim objApplication ...

Why can't I use "CompactDatabase" in DAO.DBEngine.36 using VBscript?

Hello, I'm trying to make a small VBScript that compacts a MS Access 2007 database file. The code I have is: Set acc2007 = CreateObject("DAO.DBEngine.36") acc2007.CompactDatabase "C:\test.accdb", "C:\test2.accdb", Nothing, Nothing, ";pwd=test" Set acc2007 = Nothing I'm getting this error when I run the three lines with "cscript test.v...

in QTP, how to check whether a dialog is already open?

I have been using the following code to check whether a dialog is already open If Window(window_name).Dialog(dialog_name).Exist = False Then '' //here qtp waits.. Window(window_name).WinMenu("Menu").Select menu_name End If This code is to avoid reopening the same dialog during each run of the code. But the qtp run waits abou...

need to get out of the select case

We are using a code where we need to select an item in combobox, we do this by a select case statement like Case "SelectItem" However if there are no items in the combobox the code should exit from the case."End Select" was not working.. How can we resolve the same? is there a different logic? ...

Why does recordset.RecordCount equal 1 but recordset.EOF and recordset.BOF both equal True

I have a very simple query that only returns one record. When I try to get the value out of the only column in the only record, I get "Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record." What's going on here? The code that is causing the error doesn't even execute if Recor...