Current location: Hot Scripts Forums » General Web Coding » JavaScript » Need a JScript


Need a JScript

Reply
  #1 (permalink)  
Old 12-08-03, 01:46 PM
Dazza203 Dazza203 is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Need a JScript

Is it possible to use a JScript or even VBScript to write a script for ejecting or closing a DVD-ROM or CD-RW drive? I have a Remote Control for my PC and it is possible to program buttons to run a JScript or VBScript. Any help?

Thanks,
Darren
Reply With Quote
  #2 (permalink)  
Old 12-09-03, 06:58 AM
hyjacked hyjacked is offline
Wannabe Coder
 
Join Date: Nov 2003
Location: New Brunswick, Canada
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
I'm pretty sure VBScript can open/close the drive. I'm not sure of the command though, and as far as getting your remote to do it, if you can map the buttons to files and programs, map it to the script you would have written. Programming the button directly could be done but I'd suggest against it, since you would need to get into how the remote talks to the computer.
__________________
hyjacked
Reply With Quote
  #3 (permalink)  
Old 12-09-03, 12:30 PM
Dazza203 Dazza203 is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
OK but I would need a script as I'm not a very good programmer.

Darren
Reply With Quote
  #4 (permalink)  
Old 12-09-03, 01:05 PM
hyjacked hyjacked is offline
Wannabe Coder
 
Join Date: Nov 2003
Location: New Brunswick, Canada
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
found this on google
http://www.waxy.org/archive/2003/03/27/open_cdr.shtml
Code:
<SCRIPT LANGUAGE="VBScript">
<!--

Set oWMP = CreateObject("WMPlayer.OCX.7" )
Set colCDROMs = oWMP.cdromCollection

if colCDROMs.Count >= 1 then
        For i = 0 to colCDROMs.Count - 1
                colCDROMs.Item(i).Eject
        Next ' cdrom
End If

-->
</SCRIPT>
Would be a good laugh on any page, it opens all the cdrom drives on the users computer.

just paste that into a file and call it something.vbs and you should be good.
__________________
hyjacked
Reply With Quote
  #5 (permalink)  
Old 12-15-03, 03:10 AM
Dazza203 Dazza203 is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks I've been able to assign that script to one of my Remote Control buttons to opening the drives and it works. I also found a script for closing the cd drives further down the page which I then assigned to another button. I don't know if this is possible but could a VB Script have the ability to open and close just 1 drive specified in the script rather than all of them?

Thanks,
Darren
Reply With Quote
  #6 (permalink)  
Old 01-27-04, 11:20 AM
philjeary philjeary is offline
New Member
 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
[QUOTE=hyjacked]
Code:
<SCRIPT LANGUAGE="VBScript">
<!--

Set oWMP = CreateObject("WMPlayer.OCX.7" )
Set colCDROMs = oWMP.cdromCollection

if colCDROMs.Count >= 1 then
        For i = 0 to colCDROMs.Count - 1
                colCDROMs.Item(i).Eject
        Next ' cdrom
End If

-->
</SCRIPT>
QUOTE]


I don't suppose anyone knows if this is possible to do remotely on a Local area network?
I have a couple of PC's with 1 monitor and im trying to make as many processes as possible usable from 1 pc without the aid of a switch box or programs such as VNC.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
JScript Scrolling Text-Help jah JavaScript 1 11-20-03 01:39 PM
little help with jscript and forms funkeq JavaScript 3 11-08-03 07:50 PM
How to code the jScript to open in frame astia JavaScript 1 11-06-03 09:27 AM
asp + JScript azwani ASP 3 10-07-03 11:16 PM
Mac IE / jscript / menu not showing HELp!! chris-kf JavaScript 0 09-22-03 06:04 AM


All times are GMT -5. The time now is 11:31 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.