vbscript

XPath count in VBScript

I am trying to get the number of specific nodes in an XML file using the XPath count function, however, this keeps returning an error "An exception of type 'msxml3.dll: Expression does not return a DOM node." How do I get the return value from an XPath count using VBScript and MSXML DOM Dim oXML Dim homeId Dim awayId Dim homeGoals ...

Creating a Windows checkbox in a VBScript that will be executed by cscript.exe

If I have a VBScript like... inputControl1 = InputBox("Hello World") WScript.Quit How can a check box be created in there rather then the InputBox? I know VBScript itself does not have a checkbox control like the InputBox, but is there some library I can use to do something like the following? inputControl1 = CreateObject("library.c...

Is it possible to execute a .NET assembly(dll) from vbscript?

I'd like to execute a .NET dll file from vbscript in a synchronous way - is this possible? if yes, is it possible to execute a GAC assembly? thanks, Ofer ...

To encode vb script

How to encode vb script so that others cant see the code inside ...

How to create a user account in Windows Vista using VBScript?

How to create a user account in Windows Vista using VBScript? I'm using the following script. It's working fine on Windows XP, but gives me an error on Windows Vista: strUserName = "username" strPassword = "password" strComputer = "." set objSystem = GetObject("WinNT://" & strComputer) set objUser = objSystem.Create("user", strUserName...

Word automation find out if a bookmark is in a table

I am using Word Automation to manipulate some documents (yuk!). I am using this command to get a bookmark within a document. Object oBookmark = "MyBookmarkName"; Range oRngoBookmark = wordDocument.Bookmarks.get_Item(ref oBookmark).Range; What I want to find out is if that bookmark is in a table in the document or not. Is there an easy...

invoke __dopostback inside IE via powershell

Hey. I'm writing powershell script that simulates actions performed by user on the page. I have a problem with performing click on a button. Page has form and inside button that saves changes to database: input type="button" onClick="__doPostBack('someIdentifier','SAVE')" value="Save changes" I need to invoke that from the client si...

UTF-8 Server.UrlEncode problem in ASP Classic

I'm having a bit of bother URL encoding a string of UTF-8 encoded text to pass over HTTP. I am using Server.URlEncode in classic ASP (vbscript) to do the encoding on the "é" character. It produces the following string, %C3%83%C2%A9 The system I am talking to over HTTP is PHP however and it cannot decode this string. Using a PHP encode...

Access network share from within VBScript eg FileSystemObject

Is there a good way to access network shares from within a VBS script, with alternative credentials (not the credentials with which the VBS script is running)? The intention is to perform two tasks: programmatically navigate a remote share file structure, in order to confirm that a couple of remote files exist, and copy one file over ...

VBS- String split multiple on multiple lines into array

I'm trying to create a function that will take a string which could be over multiple lines, e.g.: "declare notThese declare orThis hello = $notThis@butthis$ butNot= $ButNotThis$ andDefNot = getDate()" And search through it, pulling out {string1}'s from all parts like ${whatever}@{string1}$ and then pushing them into an array. H...

Accessing & Manipulating DBF from Classic ASP 3.0

Hi there, Usually i use SQL Server as database for my project, but one of my project deals with ESRI shapefile that use .dbf format as database (i think it was DBASE III or IV format). I want to create some web interface for modifying value that already exist on dbf, example was make customer can edit street name if it were incorrect o...

Is anyone successfully editing .vbs scripts in Visual Studio 2005?

I'd like to do some VB Scripting and am looking for a good editor. It occurs to me that I might be able to just edit it with VS 2005. Are you using VS 2005 to edit .vbs scripts? Any pointers on that? ...

Quotes in vbscript string causes wsh invalid url error

I'm trying to get the script below to produce a shortcut like this: "C:\Program Files\Internet Explorer\iexplore.exe" http://WebApp/index.aspx set WshShell = WScript.CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") set oUrlLink = WshShell.CreateShortcut(strDesktop & "\WebApp.url") oUrlLink.TargetPath = ...

VBScript: Function returns an array

I have some VBScript code where a function returns an array. function PreProcessFile (sFile) dim deData(3) ''populate deData with strings PreProcessFile = deData End function The code calling this function errs with a type mismatch. Any thoughts? '' VBScript source code Dim m_deData(3) set m_deData = PreProcessFile("...

ActiveX component can't create object

I have just installed a third party app on my Windows Server 2008 server and I get the "ActiveX Component can't create object" Message when I try to access using a CreateObject in VBScript. It is definitely installed and exists under "Programs and Features". Does anyone have a list of things that I can check to find figure out what is ...

How do I build a secure webservice with .Net?

I need to build a simple webservice to get data in and out of a HR System over the Internet (it's a hosted solution). I am using IIS and ASP.Net with .Net 2.0. Having looked into it, there are several ways of making the webservice secure - I am after some advice on which method to choose, with some views on pros and cons. These are th...

Classic ASP Twitter Libraries

Does of anyone know of any Classic ASP (VBScript) Twitter libraries? Thanks. ...

My script won't run under the task scheduler. Why?

I have a vbscript script that I runs fine when I am running it myself. For some reason, when I run it under the task scheduler as an administration user, it runs, but doesn't even write to my log file. It shouldn't be permissions, as the user I run it under is adminstrator. Its a script calling 32 bit dlls on a Win2008 64 bit machine....

VB Script GetObject method error...Help please WMI

Hi below is the code, at this point i get error message: Set objWMI = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\cimv2") Error: Invalid procedure call or Argument: "GetObject" Code: 800A005 Source: Microsoft VBScript Runtime error ...

how to perform a task after stopping the test run?

Hello, I was just trying to perform a task after i stop the test run in QTP. The actual scenario is like this: I want to login into some site(project internal), perform some task and when i stop the test run, it should automatically logoff from the site. There is a logoff button too on the web page. But the challenge is that we hav...