vbscript

Can I set CharSet for every page load? (Classic ASP)

I have made some changes to a Classic ASP application which breaks foreign letters unless "Response.Charset = "utf-8"" is set in every page... And it's a lot of pages... Could I force the Charset to utf-8 for every page without having to set it in each page? ...

HTTP request with Windows script host (.hta)

I can't believe I'm stuck here, but I can't seem to make a simple HTTP request using Windows script host or simple .hta file. This is my code: <script language="Javascript"> window.onload = function() { var http = CreateObject("Microsoft.XmlHttp"); }; </script> When I start the .hta file I get a JavaScript error saying something ...

Getting an error - content type 'text/xml; charset=UTF-8' was not the expected type when requesting a wcf using a xmlhttp by vb script

Hi i am new to wcf and xmlhttp, i am using vb script to send the request. i am getting the following error "Cannot process the message because the content type 'text/xml; charset=UTF-8' was not the expected type 'application/soap+xml; charset=utf-8'." Please find my code below, g_XMLLink = "http://dev1.xxxxx.employer/employer/v02/Empl...

How to prevent 'DROP BOBBY TABLES' when user enters a password with special characters?

In our ancient Classic ASP environment, we utilize OWASP to get the password from the request object and encrypt non-alphanumeric characters. This is a first line of defense to preventing sql injection. We use other methods for full sql injection prevention. The problem is, when we are collecting data to put together an HTTP post mess...

Wait for program to complete

To monitor the bandwidth usage and not to unnecessarily load programs in the start up,I want to execute the dumeter.exe then firefox.exe.When I shutdown firefox it should kill dumeter.I used the following code to start Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "c:\progra~1\dumeter\dumeter.exe" WshShell.Run "c:\pr...

LDAP or VBscript to list all real users in AD

Good morning all, Please can you help me with a LDAP query or VBscript to list all current users; real, flesh and blood people so it must exclude service accounts, administrator accounts and shared mailboxes. If you can help with this, it would be greatly appriciated. Kind regards, Justin ...

Convert this C# code to Classic ASP / VBScript??

I know this sounds backwards, but I have to convert this from C# to Classic ASP. I don't know any VBScript so I need help. In my C# code, it is reading appkeys in the config file, parsing them, and using loops to perform a process. I don't know how to do dictionaries and I/O stuff in VBScript. Can someone please help with this? These a...

How to create key/value pairs in ASP?

How do I do something like this in ASP / VBScript? Dim pairs pairs= Dictionary(String, Integer)() For Each item As String In storage Dim temp temp = item.Split(".") pairs.Add(temp(0), temp(1)) Next ...

What is the difference between Application("Something") and Session("Something")

While debugging a classic ASP application (and learning about classic ASP at the same time) I've encountered the following Application("Something") = "some value" and elsewhere in the code this value gets used thus: someObj.Property = Session("Something") How does the Application object relate to Session? ...

Setting the screen position of a program

How do I set the position of a third party program,using vbscript,to always display at a specific position on the screen? ...

Parse single XML entry in classic ASP

Hi Everyone, I am trying to parse a single XML entry with no name in ASP classic and having issues getting it to resolve to an object? Here is what I am trying: result = xmlDoc.selectSingleNode("//Boolean") I have also tried: result = xmlDoc.selectSingleNode("//Boolean").Attributes.Text Neither of them return an object, this is m...

Call Oracle stored procedure from ASP VBscript

I have found the following ASP VB code from Microsoft Support, and as it is stated it should print in my browser the parameters that are required from my called stored procedure. I get the following error when I run it in my browser: Microsoft OLE DB Provider for Oracle (0x80040E14) ORA-06550: line 1, column 7: PLS-00306: wrong number o...

vbscript: convert unicode string to array of bytes

I have unicode string passed to vbscript procedure (not visual basic 6, but vbscript). I want to iterate unicode string char by char, get code for every symbol, truncate code to byte range [0..255] and create array of bytes. This way new array of bytes should be twice smaller in memory compared to original unicode string. I am going sa...

MySQL Check if a database exists

I'm trying to determine if a database of a certain name exists and then create it if it does not. Ideally this would be in VBScript. I currently am trying using a loop search of an array but the total number of databases will change greatly. set dbQuery = ConnSQL.execute(checkDBsql) if dbQuery.BOF and dbQuery.EOF then ' Que...

WMI namespace root\cimv2 not available on Win2k?

Hi, I'm trying to run the following VBScript code on a Win2k SP4: strComputer = "." Set oWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") It works on XP and Win7 without problems, but on this 2k box I get the following error: C:\test_wmi.vbs(3, 1) (null): 0x8004100E The ...

What is the PHP equivalent of the VBScript CStr function?

I have the following VBScript code, which I'm converting to PHP: result = MyLibrary.InitSLibLibrary(cstr(LicsKey)) ScannerErrorAlert result Can anyone tell me the PHP equivalent of the CStr function used in this code? ...

C# COM Class - DISP_E_UNKNOWNNAME

I have declared a COM visible class in C#. The code is as follows: [ComVisible(true)] public class AComVisibleClass : TheParentClass { public bool SomeFunc(string id) { return true; } } This class is instantiated by a factory class, also COM accessible. But if I try to access in a VB script file, a DISP_E_UNKNOWN...

VBS: Check IP address and open URL (but only once)

I'm trying to create a VBScript which will detect if the computer it is being run on is connected to our LAN at work by checking its IPv4 address (assigned by DHCP) and then open a specific URL depending upon whether it is inside or outside our network. The script will be mainly used on laptops which will roam between work (10.12.90.0/22...

vbscript to grab newest file on ftp site

I need to comeup with a vbscript to grab a file from an ftp site where the file name is in the form "vendor(date)(date)(random#).zip" . These files are updated daily so I need a regex or way to select the newest file on the server and download it. I know how to handle this on the local file system, but I don't know how to determine which...

Stopping VBScript executing when page loads

I have a form that submits to a different page to the one it is on. I want to catch the onsubmit for the form and perfom some VBScript code. Am I right in thinking like with Java code in a JSP, everything in <% %> will be evaluated before the html is rendered? Here is a brief overview of my problem: <form id="frm1" method="post" actio...