vbscript

how to call Rasapi from vbscript

I need to write a VBScript script to check the state of a dial-up connection, perform the dial up if disconnected, hang up the connection etc. I know this can be done using RAS API functions, so I'm wondering if there's any way to call these functions from VBScript? If not, how else can I manage dial-up connections using VBScript? Can so...

Fixing VBSCRIPT inaccurate mathematical results due to rounding

Try running this in a .VBS file MsgBox(545.14-544.94) You get a neat little answer of 0.199999999999932! This rounding issue also occurs unfortunately in Sin(2 * pi) since VB can only ever see the (user defined) variable pi as accurate as 3.14159265358979. Is rounding it manually (and loosing accuracy) the only way to improve the re...

passing variable from vbscript to batch file

i am using vbscript to call a batch file. my script looks like: dim shell set shell=createobject("wscript.shell") shell.run "a.bat" set shell=nothing my batch file is simple and looks like: D: cd D:\d winzip32.exe -min -a D:\a i want to pass a variable from a script to the batch file. lets say the destination f...

How to call c# function from asp page

can i integrate asp and aspx pages wchich are not concerned with session so there wont be any session related issues but are there some other issues? i am not getting how to call c# function from my asp page ...

Macro to copy data from one sheet to another based on the current date

Does anyone have a macro that copy data from one sheet to another based on the current date? I am working with a single workbook of three sheets. Sheet one will hold the manual input of daily production figures for multiple plants, sheet two is to hold ongoing daily data, keyed on sheet one. The macro will be associated with a button,...

document.getElementByID - checking whether an element has been found or not

Hi, guys. Here's a sample code, that opens an internet explorer window, navigates to google, and gets some element on the page by its unique id: set ie = CreateObject("InternetExplorer.Application") ie.navigate("www.google.com") ie.visible = true while ie.readystate <> 4 wscript.sleep 100 WEnd set some_object = ie.document.gete...

how to call more than 1 batch files in a vbscript?

i use following code to call a batch file: dim shell set shell=createobject("wscript.shell") shell.run "a.bat D:\a" set shell=nothing how do i call more than 1 batch files, so that when 1st file's execution is over, the 2nd file is executed. as always, i really appreciate any help offered. ...

passing variable to a batch file when called using "call" function.

i want to call a batch file from another batch file and also want to pass a variable to it. lets say i want to call b.bat from a.bat. my b.bat copies files. so while calling it from a.bat , i want to pass the path of the destination folder to b.bat. well to b more clear, the destination path will b entered by user, so it will b stored in...

passing variable to batch file from vbs

i want to pass a variable from vbscript to batch file. i used :shell.run "c.bat D:\d" and in c.bat recieved it as %1 i.e xcopy %1 D:\o\ /E it works fine. but actually the path is to be entered by user. so it is saved in a variable say x. how do i pass this variable to the batch file? ...

VBScript Work out if a person is over 18 based on their Date of Birth

Hi all, I have my users DOB as a string (don't ask), how can I reliably check to see if they are over 18? Would I use DateDiff? How would I convert the string to a date first? The date is in dd/mm/yyyy format. Many thanks Jonathan ...

how can i access C# dll from VBScript on client machine

i have created a C# dll file on my machine as shown below: namespace myDLL { public class myClass { public string myFunction() { return "I am Here"; } } } then i created a tlb file with "tlbexp" command, then i used the "regasm" command n registered this dll on my machine. When i created an ...

How can I clear the cache in an Outlook client programmatically?

I am executing the following routine often in order to clear the local cache of many Outlook clients (Outlook 2003) in order to fix corrupted Forms stored on the users local drive. On the Tools menu, click Options, and then click the Other tab. Click Advanced Options. In the Advanced Options box, click Custom Forms. In the Custom Fo...

How do I associate Parameters to Command objects in ADO with VBScript?

I have been working an ADO VBScript that needs to accept parameters and incorporate those parameters in the Query string that gets passed the the database. I keep getting errors when the Record Set Object attempts to open. If I pass a query without parameters, the recordset opens and I can work with the data. When I run the script throug...

passing variable to a function.

its kind of silly question. but i dont know what mistake i am making. if any one could help. <html> <head> <script type="text /vbscript"> function zips(s) document.write(s) end function </script> </head> <body> <script type="text/vbscript"> dim x,y x="sushant" <button onclick="zips(x)" id=button1 name=butt...

use dll from remote computer

I have two computer PC1 and PC2 In PC1 I have a .Net C# dll file that provides operations on SQL Server database. My question is - "how can I use this dll file on PC2 through VBScript within Outlook 2003". I tried this same task on PC1 and I succeeded using the CreateObject("dllfilename.classname") method of VBScript within outlook 20...

VBScript and JScript seem to handle element.click method in a different manner. Why?

Hi, guys. Here's another sample script in VBScript. It opens internet explorer, navigates to google, sets up a search field and submits a query. set ie = CreateObject("InternetExplorer.Application") ie.navigate("www.google.com") ie.visible = true while ie.readystate <> 4 wscript.sleep 100 WEnd set fields = ie.document.getelemen...

classic asp delete rows and columns from an excel file

Hi, how can I remove specific rows and columns from an excel file using only classic ASP? For example, given the excel file col1 col2 col3 one two three four five six I want to be able to programmatically delete the first row and second column to produce one three four six Thanks! ...

Parsing out information from a LinkedIn profile using VB Script

Does anyone have an example that parses out the information from a LinkedIn profile using VB Script? I have a database which contains client information and I have been including the client Key for LinkedIn in hopes to have it automatically update some or possibly all of the information for that client. Sincerely, Christopher J. Schäre...

running an exe in asp

Hi, I have an ASP site(not asp.net, old asp) which executes some lines on the server-side. I want to run an exe in the server side code, but i'm not familiar with asp programming - the site I got was already built, i just need to add this little code and that's all. I think the ASP code is in VB as it's very familiar to VB and has the s...

executing batch files sequentially

dim shell,x,y x="D:\d" y="c.bat " & x set shell=createobject("wscript.shell") shell.run y shell.run "a.bat" set shell=nothing when i run this script, it runs both batch files simultaneously. what i need is that it should run the first batch file(c.bat) and after it is completely executed, it should execute other(a.bat) what i need wor...