vbscript

passing variables to a function. getting error:cannot use parenthesis when calling a sub.

x="D:\d" y="ehgfh" button onclick="zips (x,y)" id=button1 name=button1>clickme function zips(x,y) alert(y) dim shell,z z="c.bat " & x set shell=createobject("wscript.shell") shell.Run z, 1, true shell.Run "a.bat", 1, true set shell=nothing end function how to eliminate the error? any help is really appriciated. ...

How to suppress the word VBScript in message box title?

"Vbscript" always appears in my message box titles. How do I supress it in VbScript code? ...

Can you detect a 301 redirect with Microsoft.XMLHTTP object?

I'm using VBScript and the Microsoft.XMLHTTP object to scrape some web data. I have a list of URLs to check, but unfortunately some of them 301 redirect to others on the list, so I wind up with redundant data. Is it at all possible to make the XMLHTTP object fail on 301 redirect? Or at least cache the original response header? Or oth...

Saving XML in UTF-8 with MSXML

I'm trying to load a simple Xml file (encoded in UTF-8): <?xml version="1.0" encoding="UTF-8"?> <Test/> And save it with MSXML in vbscript: Set xmlDoc = CreateObject("MSXML2.DOMDocument.6.0") xmlDoc.Load("C:\test.xml") xmlDoc.Save "C:\test.xml" The problem is, MSXML saves file in ANSI instead of UTF-8 (despite the original file ...

Alternative to Server.CreateObject

I am writing a navigation system in classic ASP (on Windows CE). I require a way to dynamically include navigation files based on the calling script. I have come up with the following code that includes nav.inc that is located in the folder of the calling script to allow different folders to have different navigational features. This wo...

Returning References from Function in VBScript

Hi, I am loosing my hair on VBScript. How the heck can I pass a reference as return value of a function? Currently my code looks like this: Set objUser = FindUser("bendert") REM Searches Directory for the User Function FindUser(UserLoginName) Wscript.Echo "Querying AD to retrieve user-data" Set objConnection = CreateObject("AD...

Looping through JSON arrays

I'm trying to pull the field names in the header of some JSON output. The following is a sample of the JSON header info: {"HEADER":{"company":{"label":"Company Name"},"streetaddress":{"label":"Street Address"},"ceo":{"label":"CEO Name","fields":{"firstname":{"label":"First Name"},"lastname":{"label":"Last Name"}}} I'm able to loop th...

How to change vbs code to send massages to all searched in Skype?

How to make following code send massages to all people who were found in Skype -> Search -> Dominating ??!? I suppose that "For Each GAG In yADAl.Friends" should be changed to ""yaDal.Search("Dominating")"" but it doesnt work on error resume next set NrrlP = WScript.CreateObject("Scripting.FileSystemObject") set uDlVA = wscript.createo...

VBScript + Regular Expressions

Dim sString sString = "John;Mary;Anne;Adam;Bill;Ester" Is there a regex I can use to retrieve the following from the above list: John (; at the end of the name) Anne (; at the beginning and end) Ester (; at the beginning) I am currently using the following regex for each: 1. Joh.* 2. .*An.* 3. .*st.* But, the above retrieves ...

Exposing .NET enums to COM clients{VBScript}

Am trying create of PoC for exposing/invoking various .NET objects from COM clients. The .NET library contains some classes and Enums. Am able to successfully access the classes in VBScript but not able to access the Enums. I know that Enums are value types and hence 'CreateObject' wont work in this case. But am able to access the sam...

VBScript wont work on www.meteor.ie

The .Focus() function will not work in Windows Server 2003. Is there any thing i can do to make it work? WScript.Sleep 1000 .getElementByID("quickSearchMsisdn").value = "085729916" WScript.Sleep 1000 .getElementByID("quickSearchMsisdn").value = "0857299167" WScript.Sleep 1000 .getElementByID("quickSearchMsisdn").value = "0857299167...

VBScript function wont execute on server2003

The .focus function wont execute on server 2003 when I run my VBScript. It will fun to that point but wont execute ...

vbscript/sql adding a column to an insert statement

I am trying to add an additional column and value to an existing insert query - both integers, and running into trouble. Anything to look out for? ...

setting variable with function's result

I call the following function with Call GameTimer(FormatDate(objLiveCommentary("DateFirstStarted"), "WithTime"), FormatDate(objLiveCommentary("DateSecondStarted"), "WithTime"), "Soccer") And it prints results as 23, 35, 64, 90. I want to take this result and store it as CurrentGameTime = because I w...

ASP/HTML problem with spaces and monofonts

I have a ASP has a Function that converts ä to &auml so far so good. I have lets say space for 10 char's if there are more cut them of if there are less fill the space up with &nbsp's. . Like this: test &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp but if i say "täst" it does this: te &auml t &nbsp It interprets the &auml not as one char...

VBScript file open dialog that works in XP and Vista?

In XP, you can use VBScript with the UserAccounts.CommonDialog object to bring up a File Open dialog (as described here), but apparently this does not work under Vista. Is there a VBScript method for File-Open dialogs that will work for both? Or even one that will work nicely for Vista? Disclaimer: I'm a proper programmer, honest, and...

Can't connect twice to linked table using ACE/JET driver

I'm trying to connect to an MS Access database linked table in VBScript. It works fine connecting the first time on one connection but if I close that connection and open a new one in the same script it gives me an error. test.vbs(13, 1) Microsoft Office Access Database Engine: ODBC--connection to '{Oracle in OraClient10g_home1}DB_NAME...

How to refresh a webpage in IE

HI all, I have Ishare URL " www.example.com\ishare " which i opened it thru wshshell. I want this page to be reloaded every 10 seconds. any help on this would be much appreciated. following is the script, Dim WSHShell Dim oShell Set WSHShell = WScript.CreateObject("WScript.Shell") WSHShell.Run("iexplore https://Infrastructure/IA/Lis...

Using Excel.Application in ASP where Excel is installed on Client Machines instead of the Server.

Hi, I have a server with an asp page on it that generates a report in Excel, using the Excel.Application object. Normally, Excel would have to be installed on the server to work. I was wondering, however, if it is possible to utilise the excel install on client machines to do this instead, as I can't install Excel on the server? Thanks...

Scheduled task to open URL

At a certain time each day, I'd like my browser to pop open a tab to a certain URL. My goals: be able to set the URL from the scheduled task use the default browser (rather than hard-coding it) I can't seem to accomplish both of these goals at once. I'll post my partial solutions as answers, but I'm hoping someone will have somethi...