Batch file for ejecting media |
![]() ![]() |
Batch file for ejecting media |
Apr 7 2008, 08:20 AM
Post
#1
|
|
|
New Member ![]() Posts: 1 OS: Windows XP |
What I would really like, however, is for the batch file to actually go ahead and eject a specific media. Since my external hard drives always have the same drive letters, I feel like this should be possible. Here's the text of the current batch file I'm using in case it helps. By the way, I know nothing about any of this programming. REM SAFEREMOVE.BAT echo off echo SAFELY REMOVE echo Starting Safely Remove %windir%\system32\RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll |
|
|
Apr 8 2008, 10:49 PM
Post
#2
|
|
![]() TA Moderator Posts: 1,281 From: SET HOMEPATH OS: Windows 95/98/2000/XP/Vista |
Welcome to Geeks to Go!
If you are trying to eject media from the your CD-ROM, you can use a VBS file for this. Save the following code as eject.vbs and then just run it using cscript.exe eject.vbs (or just double-click it if you want to test it). Opening a CD drive: CODE 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 If this isn't what you're looking for, please let me know. Ax |
|
|
Apr 23 2008, 11:13 AM
Post
#3
|
|
|
New Member ![]() Posts: 8 OS: Windows XP Pro SP2 / Vista Ultimate |
Mmmm sounds like it's not really "eject" but you want your USB devices "safely removed" automatically rather than having to do it yourself.
Here's a link that seems to have the information you need to get started: http://portableapps.com/node/639 |
|
|
![]() ![]() |
Similar Topics
| Topic Title | Replies / Views | Topic Information | |||||
|---|---|---|---|---|---|---|---|
![]() |
0 / 360 | 5th August 2007 - 09:19 PM shoryuken25 started - last by shoryuken25 |
|||||
![]() |
7 / 1,282 | 14th May 2008 - 08:18 AM bshaw started - last by sari |
|||||
![]() |
3 / 1,678 | 4th August 2008 - 08:55 AM bombasos2 started - last by Swandog46 |
|||||
![]() |
1 / 203 | 17th December 2008 - 05:50 PM aesvolleys started - last by Ax238 |
|||||
|
Time is now: 8th January 2009 - 02:01 AM |
| Advertisements do not imply our endorsement of that product or service. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk. |