So I need a operation command to open a certain drive, but I can't find it.
Can someone help?
[editline]04:00PM[/editline]
Whoops, guess I coulda' posted this in the Megathread.
Oh well..
-snip-
Google lied to me...
Have a visual basic script:
[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
Set oWMP = Nothing
Set colCDROMs = Nothing[/code]
Open notepad, paste, save as whatever.vbs
Else take a look at nircmd, fucking useful
[url]http://www.nirsoft.net/utils/nircmd.html[/url]
[code]
eject /dev/cdrom
[/code]
:smug:
[QUOTE=PvtCupcakes;23212311][code]
eject /dev/cdrom
[/code]
:smug:[/QUOTE]
But you have to umount it first :|
[quote=man eject]If the device is currently mounted, it is unmounted before ejecting.[/quote]
Damn, I should've read the manpage :<
I'm positive I read somewhere it is not possible with batch to eject a drive.
[editline]12:58AM[/editline]
Mainly related to the fact that I wanted to do something similar a few years ago.
[QUOTE=esalaka;23215226]But you have to umount it first :|[/QUOTE]
What if it's not already mounted? :aaa:
[QUOTE=Within;23264111]I'm positive I read somewhere it is not possible with batch to eject a drive.
[editline]12:58AM[/editline]
Mainly related to the fact that I wanted to do something similar a few years ago.[/QUOTE]
Not with batch, but you can do it in VisualBasic I believe.
[QUOTE=Ayra;23272614]Not with batch, but you can do it in VisualBasic I believe.[/QUOTE]
Yeah, get the batch to run the vbs script.
Assuming the batch does more than just open the CD drive.
Of course, if you wanted it to run the .vbs from the batch file, you could figure out what program is being launched when the script is run, then run it from your batch file:
[code]
C:\Windows\System32\NameOfVBSRuntime.exe "C:\Path\to\vbs"
[/code]
Or just do "C:\path\to\vbs"
I've done it before. It's fun to put it in a loop :D
[QUOTE=robmaister12;23298347]Of course, if you wanted it to run the .vbs from the batch file, you could figure out what program is being launched when the script is run, then run it from your batch file:
[code]
C:\Windows\System32\NameOfVBSRuntime.exe "C:\Path\to\vbs"
[/code][/QUOTE]
It'd probably be easier to call the batch file from the vbs script and then use the vbs script instead.
-snipo- rate bad reading
Sorry, you need to Log In to post a reply to this thread.