473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Timer or button to launch VB script?

118 100+
I am making a CD based website. I have made the code to open the CD tray... (below)

Expand|Select|Wrap|Line Numbers
  1.  
  2. <SCRIPT LANGUAGE="VBScript">
  3. <!--
  4.  
  5. Set oWMP = CreateObject("WMPlayer.OCX.7" )
  6. Set colCDROMs = oWMP.cdromCollection
  7.  
  8. if colCDROMs.Count >= 1 then
  9.         For i = 0 to colCDROMs.Count - 1
  10.                 colCDROMs.Item(i).Eject
  11.         Next ' cdrom
  12. End If
  13.  
  14. -->
  15. </SCRIPT>
  16.  
This code has to be placed in the <head> tag but will execute automatically on the loading of the page. Is it possible to set a timer for it to execute after 60 seconds, for example; or on the click of a button?

Thanks,

Sam
Apr 26 '07 #1
2 2126
AricC
1,892 Expert 1GB
I am making a CD based website. I have made the code to open the CD tray... (below)

Expand|Select|Wrap|Line Numbers
  1.  
  2. <SCRIPT LANGUAGE="VBScript">
  3. <!--
  4.  
  5. Set oWMP = CreateObject("WMPlayer.OCX.7" )
  6. Set colCDROMs = oWMP.cdromCollection
  7.  
  8. if colCDROMs.Count >= 1 then
  9.         For i = 0 to colCDROMs.Count - 1
  10.                 colCDROMs.Item(i).Eject
  11.         Next ' cdrom
  12. End If
  13.  
  14. -->
  15. </SCRIPT>
  16.  
This code has to be placed in the <head> tag but will execute automatically on the loading of the page. Is it possible to set a timer for it to execute after 60 seconds, for example; or on the click of a button?

Thanks,

Sam
This seems like more of a Javascript question or are you trying to do this with VB Script?
Apr 26 '07 #2
helraizer1
118 100+
I was thinking of a button or a timer to launch the code. Using either HTML or Javascript but I'm not sure how to do it. For instance, in a Javascript script the function has a name such as: "function1()" so then you can say using HTML:

<input type="button" onClick="function1()">
-or-
<Body onload="function1()" onunload="stoptimer()"> etc...

But for the VBScript I don't know how to execute it with a button using HTML or Javascript. At the moment when it is in the <head> of my site it executes the script as it loads the page.

Any ideas?

Sam
Apr 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Daniel P. | last post by:
I'm trying to set a timer that gets called every 3 seconds so I can update a field in the UI with the time elapsed since the process started. What am I doing wrong that timerDF_Tick does not get...
7
by: IntraRELY | last post by:
I am using the following command to launch and .NET VB Executable, which is a simple Windows Form (printCheckClient.exe). I am using a HyperLink Control and works perfect....
3
by: helraizer1 | last post by:
I am making a CD based website. I have made the code to open the CD tray... (below) <SCRIPT LANGUAGE="VBScript"> <!-- Set oWMP = CreateObject("WMPlayer.OCX.7" ) Set colCDROMs =...
16
by: Peter Oliphant | last post by:
Note that although this involves SAPI, it is more a question about Timers and event handlers. I wrote a Speech Recognize handler (SAPI), and put some code in it to enable a Timer. It would not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.