vbscript

Setting a registry value Programatically using vbscript

I would like to change the ie setting under: Internet Options->Security->Trusted Zones->Custom Level->Miscellaneous->Enable I have done this with other registry keys like "Disable Debugging" and such. But I can't seem to set this value to enable. Here is what I have so far: WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVer...

List all virtual directories in IIS 5,6 and 7

I am trying to create a list of all virtual directories within an IIS site. However, I have found that trying to do this varies dramatically in the older versions of IIS. In IIS 7 this is a relatively easy task via C# but I can't seem to find a good method for doing this in IIS 6 and 5. I have tried using the System.DirectoryService...

How do I logout from vbscript?

I'm using a VBScript to run an application on my Win Server 2003, and I want it to log the user off after a set amount of time. Something along the lines of: Set WshShell = WScript.CreateObject("WScript.Shell") Set OExe = WshShell.exec("somecommand.exe") WScript.Sleep 1000000 OExe.Terminate <Insert LogOff code> ...

Java Tree present within java Table.

I have a simple Scenario where i want to expand the node of a Java Tree which is present within a Java table. This Java Tree is not able to get recognized when i tried to spy. it is showing only the properties of Java Table. When recorded i got this below code. javaWindow("sss").JavaTree("aaa").Expand "abc;value1" javaWindow("sss").Jav...

VBS login script not functioning correctly

I have a login script that checks for a registry key and if the key is not found it runs a script that creates an outlook signature from info in AD then adds a key to the registry. The script has run perfectly on about 20 machines that i have tested it on, however it doesn't work correctly on 3 machines. For these 3 machines it passes th...

Converting an HTA into an ASP page?

I was given an HTA that I think was created by the HTA_Helpomatic. They want it converted into a classic ASP page. So I made a few basic changes, and I think I almost have it working. But I'm running into a problem - the ole 'VBScript Object Required' bit. It's doing this on the line Set objlst_groupnames = document.getElementById( "list...

"Continue" (to next iteration) on VBScript

A colleague and I were trying to figure out a way of doing the equivalent of a "continue" statement within a VBScript "For/Next" loop. Everywhere we looked we found people had no way to do this in VBScript without having nasty nestings, which is not an option for us since it is a quite big loop. We came out with this idea. Would it wor...

Open url from script on Windows Server 2008

I want to write a script that loads a url (eg. http://google.com) automatically. But I don't want to install any 3rd party libraries or programs to the server. what's the easiest way to do this? I just my options are batch script, vb script or powershell right? ...

Changing IE Standards/Quirks mode at run time with an instance of InternetExplorer.Application

A similar question has been addressed with WebBrowser Control however I'd like to ask how to directly manipulate document modes with a VBS initialized/controlled instance of InternetExplorer.Application - or how to apply the registry fix in the above mentioned post to this scenario. Currently I'm employing a rather poor solution of simu...

Where Is the Syntax Error in this SQL?

I've got a query that is pretty much the same as many others which are used in the same library... but I did a lot of copy&paste on the SQL to add features to each one which are all similar but slightly different. Just below is the section which gives me the SQL Parser error. It fires at the Set rs = line. dim sql, rs sql = "DECLARE @st...

Changing Firefox proxy settings?

How can I change Firefox's proxy settings from a script like a vb script or maybe .net? If someone could show me how to do this it would be great. ...

wscript.exe silently dies with no messages in event log for com object that uses rfc

I have com object written in c# that relies on c++ library that has rfc calls inside. Com object exposes single method (let it be DoSomeRfcStuff) that returns string. It's implementation is wrapped by try/catch block: string DoSomeRfcStuff() { try { .. Do Some Rfc calls ... } catch(Exception ex) { return ex.ToString(); }...

Building an XLA from Source Programmatically

I have a (version controlled) folder of exported components of a VBA addin (i.e. a lot of cls, frm, frx, bas and txt files). Can someone give me a build script (can be a VB script, or something more complicated) that takes the name of this folder and produces a (working) XLA? I know you can programatically modify XLA files (e.g. this q...

VBScript current directory + sub directory?

I am trying to get the path of a file that is within a sub-directory of the current directory in VBScript. The following does not seem to work? currentDirectory = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(len(WScript.ScriptName))) FileToCopy = currentDirectory & "\test\user.js" Here is the entire code: Set oFSO = Cre...

get the description from an WMI class using vbscript

Hi, i need to know how can get the descrption from an WMI class using vbscript. i just founs this example but is in C# // Gets the class description. try { // Gets the property qualifiers. ObjectGetOptions op = new ObjectGetOptions(null, System.TimeSpan.MaxValue, true); Management...

How to list all WMI event classes using VBScript?

Using VBScript, how can I list all WMI classes that represent events? Thanks in advance. ...

How to return a database connection from a function?

I need to modify some legacy code that was written in classic ASP (VBscript). I have a line that sets a database connection like this: set m_conn=OpenConn() I believe that the OpenConn() function is in a DLL somewhere. This is bad news because we can't locate the source for that dll. So, I've been working on a replacement for that fu...

Looking for a way to scrape urls from a page and output it to a text file

I am looking for a way to scrape URLS from a web page and output it to a text file. E.g if a page contains multiple http://example.com/article I want to grab both these URLS and output it to a text file. ...

VBScript not exiting out of 'Do-While' loop?

Hi, alL! Since VBScript has notoriously bad built-in error handling, I've tried getting around that by wrapping my main blocks in a Do While Err.Number = 0 loop. Theoretically, this should work: if a script has On Error Resume Next statement enabled, the script will bypass the built-in error handler in WSH (i.e. stop it completely) whil...

How i can get the types of the parameters of an method for a WMI class

How i can get the parameters types of an method for a WMI class using vbscript actually i'm using this script strComputer = "." strNameSpace = "root\cimv2" Set objServices = GetObject("winmgmts:root\cimv2") Set objShare = objServices.Get("Win32_Share") Set objInParam = objShare.Methods_("Create"). _ inParameters.Properties_ For E...