vbscript

vbscript traverse through xml node- dynamic if else, node count detection

myXML= "<?xml version=1.0 encoding=iso-8859-1 ?>" & vbcrlf & _ "<shippingRates code=fedex >" & vbcrlf & _ "<errorMsg>" & vbcrlf & _ "Sorry, no rates returned." & vbcrlf & _ "</errorMsg>" & vbcrlf & _ "</shippingRates>" & vbcrlf & _ "<shippingRates code=CUSTOM >" & vbcrlf & _ "<shippingRat...

Automatically convert VBScript properties to VB.NET

Hello Migrating an old ASP site to .NET, and there's a load of VBScript we're porting to VB.NET. Getting into trouble with the old property syntax, does anyone know of a tool (or other such magic) that could do this automatically? Googled, but no joy. Thanks Duncan EDIT: VB Script properties look like this: Public Property Get AgeC...

What is the difference between VB and VBScript

What is the difference between VB and VBScript? ...

VBScript - using IF statements in a mail script?

I really need some quick tips here. I've got this VBScript script which sends an e-mail. And I want to do several checks to see if an attribute is true and if it is, write an additional line in the mail. How can I do this? This is part of the script: obMessage.HTMLBody = ""_ & "<MENU>"_ & "<LI type = square>This is...

ShellApplication "CopyHere" randomly deleting files

I have the following VBScript program to zip up files. It works fine most of the time, except that it seems to occasionally delete a file that it is zipping! This condition is trapped by the script. Can anyone suggest what might be causing this? Code is: ' ' VBScript to compress all files in a specified directory that match a given pr...

On ASP.net Button click populate a ASP.Net textbox using VB Script

Hello, I have a vbscript function which will get a value from ActiveX control IntegriSign1 as shown in the code below. I have a ASP.net Texbox and ASP.net Button in my asp.net page as show in the code below. From my GetSignData() function How can I populate txtIntegri1 with SignData Value Thanks <script type="text/vbscript" > sub Ge...

PSEXEC redirect output to local file

I need the correct way to accomplish this via a vbscript. This works fine from command prompt: psexec \\99.99.99.99 -u username -p password cmd.exe /c ver > output.txt From the vbscript: sTempFile = objFSO.GetTempName sCmd = "psexec \\" & sIP & " -u " & sDomain & "\" & sUser & " -p " & sPassword & " cmd /c ver > " & sTempFile ...

How to copy from a database to a text file using VBScript?

I have an example in C# code, but it is using streamWriter. It must be involving with FileSystemObject rite. If yes, what are methods should I use? I want to code using VBScript WSH, and my database is MS SQL Server 2005. Any solution, references, or guide are helpful. using (StreamWriter tw = File.AppendText("c:\\INMS.txt")) { us...

Calling a VB.net Function from VBScript

In my aspx page I have a button and onClientClick I am calling a vbScript function. I need to use VBScript as the third party ActiveX supports only vbScript. OnClientClick I am populating couple of ASP.net textboxes. How do I call a VB.net procedure that is in the code-behind from vbScript. As I cannot call both OnClientClick and onCli...

Read Exchange using VBScript

I wrote this code in ColdFusion to read data from Exchange and am wondering if anyone can help me to code this using Visual Basic Script: <cfldap server="insert_my_server_name_here" username="zzz\zzzzzz" password="xxxx" port = "123" action = "query" name = "data" attributes = "company" filter = "(&(objectclass=group))" ...

FileSystemObject - Reading Unicode Files

Classic ASP, VBScript context. A lot of articles including this Microsoft one, say you cannot use FileSystemObject to read Unicode files. I encountered this issue a while back, so switched to using ADODB.Stream instead, per the ReadText example here, instead of using FileSystemObject.OpenTextFile (which does accept a final parameter in...

part of the vbscript code gets trashed with hyphens

on some computers, when a client opens the specific html page, part of the vbscript code on the client side gets trashed with hyphens. i saw that the vbscript code on that page was composed of one huge code section enclosed in script start and end tags. i decided to fragment it to small sections, and it seemed better, but when i fragmene...

VBScript on checking if the records exist.

I have a table and a text file. Once the records in the table copied into textfile, the records will be deleted. But the table are still in used and will be inserted with a new records from time to time(by another program). I what to do checking on How to make sure that if there are no records in the table, the program will never copy i...

Detecting a DLL version number using a script

I would like to write a script that can recursively scan the DLLs in a directory and generate a report of all of their version numbers. How can I detect the version number of a DLL using a script? VBScript solutions are preferred, unless there is a better way. ...

how to visit every computer on the network and modify the host file in windows xp

Hello all, We need to append a line to the hosts file for every user on our network. I have admin privileges, but don't know the first thing about windows scripting. Can someone point me in the right direction on this? I don't have the list of all the machine names, so I'd prefer a script that would discover all the machines on the n...

VBScript to iterate through Set level of subfolders.

Ok, Ive got a vbscript that iterates through a directory and its subfolders to retrieve a list of files. Example here: Set FSO = CreateObject("Scripting.FileSystemObject") ShowSubfolders FSO.GetFolder("C:\Scripts") Sub ShowSubFolders(Folder) For Each Subfolder in Folder.SubFolders Wscript.Echo Subfolder.Path ShowSub...

VBscript compiler

Can anyone recommend a free vbscript compiler (or cheapest possible) Thanks, JOD ...

Classic ASP FormatNumber weirdness

We have a recently internationalised application written in classic ASP. The following code replicates the issue. The value of that field in the recordset is "8.90" and is typed as varchar(255). session.LCID = 2057 nNumber = recMessages.fields(lCounter) Response.Write nNumber '' # prints 8.90 Response.Write FormatNumber(8.90) '' # print...

"cp --parents" in batch file/VBScript

How would you write this having only batch files and VBScript at your disposal in a Windows environment? find -name '*.ext' -exec cp --parents {} destination/ \; Or put it this way: Look recursively in the current folder for some filename pattern (ending with an extension called ext in the example above), Copy each of these files to...

Is there a Windows API to modify file type associations for an extension?

I'm looking for a way to programatically tweak the particulars of a file association on a Windows system. For example, the "Application User to Perform this Action" setting for the "Open" action for a particular file type. Clearly I could do this by modifying the registry directly, but if there is an API I'd prefer to use that as it wou...