vbscript

What would the best way be to take a string from a text file and search and replace another string with the one from the text file?

What would the best way be to take a string from a text file and search and replace another string with the one from the text file? E.g c:\output.txt has abcd and c:\newfile.txt has Stack overflow is great. I would like to replace great with abcd. What would be the best approach to do this? ...

How do you detect window.open(...) from within an HTA?

I am developing an HTA that will run as a kiosk in our reception area. This kiosk can display web-pages that launch new windows using the window.open() method. What I want to do is handle window.open() from within my HTA, so instead of spawning an Internet Explorer window, the new window will appear in a floating iframe inside the HTA. ...

"Open with" Options through vbscript

Hi Manually we right click on a file and select the "open with" option to open in other format.Now i need to do this through vbscript Thanks in Advance ...

Retrive the child items from JList

I'm trying to retrieve the child Items from Jlist within a Jtable. I'm facing this difficulty. 1) Jlist is present within a Jtable. Jlist is not able to get Identified. How can i add the properties of the Jlist into the Repositories during that time. I can see "No" properties present when Used Object-spy. 2) How can i retrieve the chil...

vbscript code for pattern design

can anyone help me with a vb code that i'm struggling to do. I'm just a novice when it comes to programming. Exercise says: Get an integer n from a user, print out the following pattern on the screen depending on user input Pattern 1 - when n is 3, there are 5 rows in total pattern 2 - when n is 4, there are 7 rows in total In the outp...

Dynamic arrays in VBScript with Split(). Is there a better way?

Hi, all! A lot of the scripts I write at my job depend on the creation of dynamically-sizable arrays. Arrays in VBScript make this a pretty arduous task, as one has to Redim arrays every time one wants to resize them. To work around this, I've started making comma-delimited strings and using Split(...) to create 1D arrays out of it. Wh...

vbs cmd path space

Hi all, I would like to be able to call the following cmd command from within a vbs script: cmd Client\setupclient.exe /q /targetdir "c:\program files\Microsoft CRM" I came up with the following vbs script: Set oShell = WScript.CreateObject ("WScript.Shell") oShell.Run "cmd /c Client\setupclient.exe /q /targetdir c:\program files\M...

How do you use XPath to confirm whether a Form element is found in the passed in markup for loadXML?

Set objNoFormCheckXMLDOM = CreateObject("Microsoft.XMLDOM") objNoFormCheckXMLDOM.async = "false" objNoFormCheckXMLDOM.setProperty "SelectionLanguage", "XPath" objNoFormCheckXMLDOM.LoadXML(strHtmlResponse) Set nlForms = objNoFormCheckXMLDOM.selectNodes("form") I have the above VBScript in a function. strHtmlResponse contains t...

VBscript to monitor system performance leaks memory

I have a simple script that monitors processes' different performance statistics in Windows XP in a loop until it is terminated. Despite my efforts, the script's memory footprint increases in size over time. Any advice is greatly appreciated. Set fso = CreateObject("Scripting.FileSystemObject") logFileDirectory = "C:\POSrewrite\data...

Executing VBScript step by step in c#

Hello, I want to write a program is C# that will allow me to execute a vbscript step by step like I would do in a debugger. I know I can run vbscript by creating a new process class form System.Diagnostics but I was wondering if that will allow me to execute one line of vbs code at a time. Background:We have this UI automation framewo...

Is there a better way to check for Virtual Directory and if not, Create it?

Hi All, I have some vbscript code I use to set paths to virtual directories when a developer switches his/her environment to work on another project. Currently, we try to set the path, and if there's an error, we create it. It just smells funny. Is there a way to check if a Virtual Directory exists? And if not, create it? set objIIS = ...

VBScript syntax highlighting in VS2008?

Hi, ive got a few problems with my graphics driver and VS2010 so i wondered if someone could tell me how to get the syntax highlighting for VBScript on VS2008? I cant install IIS at the moment, but i have applied all the latest VS updates. ...

Recovery Group with Exchange 2003 and Python

Is there a way to create a recovery group in exchange 2003 with python? Maybe CDOEXM or VBScript? But I have been unsuccessful in finding any sample code. Any ideas? ...

intercept shutdown in windows using vbscript

Hello guys, I want to write a vbscript that will wait for windows shutdown and intercept to carry out proper action before shutting down. I want this to be in vbscript since am using it for administration. ...

Enable console application's output to scripts

Hi, I have a small C++ console application which presents a menu then performs the chosen operation. In addition, I've written a VBScript which runs over the StdOut (achieved by Exec) and enters to StdIn the values. However when I'm trying to executet this script the console application is stuck in the scanf call and the script doesn'...

Vbscript - Read ini or text file for specific section

Hi, I know I'v done stuff like this before, but I'm trying to find the most efficient way of doing this. Basically, I want to store some addresses in a text file and then read specific portions of the file, based on group membership. I've done all of the group membership stuff so I don't need any help for that. But I'm not sure if I ...

vbs script which immitates mouse clicks

Hi, I have a program which can't be killed with taskkill or pskill. Now my idea was to let a vba script fake mouse clicks and run this script from a batch file. My question, can anyone tell me of give me an example how to do this? I don't know how you call this method. Edit: It seem it can be done with special sendkeys commands. ...

How to round down to nearest X number - pseudocode for VBScript

Hey I'm trying to round down a number to the nearest say 15, 20, 30. ie 726 to the nearest 30 is 700 714 to the nearest 15 is 700 etc VBScript code would be very helpful but pseudocode would also be a huge help! EDIT: Sorry, I forgot to say, that 726 is really a time expressed as an int, ie 07:26. So this should be 07:00, not 690 E...

Implementing lazy-loaded modules in VBScript

A while back, I needed a solution to sanely import libraries in VBScript. VBScript, for reference, has no build-in import capabilities. The traditional method of importing files is to use SSI, which dumps the contents of the includee verbatim into the includer. This is less-than-optimal for a number of reasons: there is no way to avoid ...

how to add a attribute in existing xml using vbscript

Hi Guys, I have below xml and I am using VBSript to generate it. <?xml version="1.0"?> <tcm:ListItems xmlns:tcm="http://www.tridion.com/ContentManager/5.0" ID="tcm:481-86880-2" Managed="10682"> <tcm:Item ID="tcm:481-594051"/> <tcm:Item ID="tcm:481-594088"/> <tcm:Item ID="tcm:481-594089"/> <tcm:Item ID="tcm:481-594090"/> <tcm:...