Eject() - For CD/DVD and USB Mass Storage devices

Post your working scripts, libraries and tools
Best-Code-in-Use
Posts: 139
Joined: 01 Dec 2015, 05:13
Location: Germany

19 Apr 2016, 01:17

@rhinox202

Have you test this=

Greetings Best-Code-in-Use
Best-Code-in-Use
Posts: 139
Joined: 01 Dec 2015, 05:13
Location: Germany

Eject() - For USB Mass Storage devices

19 Apr 2016, 01:34

@SKAN

Hello,

thank you for sharing this script.
I have one Question:
Is the Performance for USB Drives not much better, if previously not the type of a Drive to be determined?

Code: [Select all] [Download] GeSHi © Codebox Plus

DriveGet, VAR, Type, % DRV := SubStr( DRV, 1, 1 ) ":"
If ( VAR = "" )
Return ( ErrorLevel := -1 ) + 1

If ( VAR = "CDROM" ) {
Drive, Eject, %DRV%
If ( nTC + 1000 > A_Tickcount )
Drive, Eject, %DRV%, 1
Return ( ErrorLevel ? 0 : 1 )
Greetings Best-Code-in-Use
rhinox202
Posts: 8
Joined: 30 Sep 2015, 10:22

Re: Eject() - For CD/DVD and USB Mass Storage devices

19 Apr 2016, 18:26

Thanks but I am already using the SetWorkingDir line, courtesy of an earlier post. Is it safe to assume that you aren't seeing this issue? I'll have to try compiling a simple script.
Best-Code-in-Use
Posts: 139
Joined: 01 Dec 2015, 05:13
Location: Germany

Re: Eject() - For CD/DVD and USB Mass Storage devices

20 Apr 2016, 00:37

Yes, i have read that your Script is working,
when it is not compiled...
But lexikos post is not part of the Original Script.
:D

A really better control for the exe file is possible with this Script:
https://autohotkey.com/boards/viewtopic.php?f=6&t=16061

I'm not a Programmer, but this can be helpful...
Greetings Best-Code-in-Use
rhinox202
Posts: 8
Joined: 30 Sep 2015, 10:22

Re: Eject() - For CD/DVD and USB Mass Storage devices

26 Apr 2016, 13:59

Thanks anyway for the help. I was trying to allow a compiled EXE to run from a flash drive and also eject said drive, but I can't get it working. Instead, I've resorted to running the EXE on the Desktop and having it eject the drive. After a little more thought, this seems to be the best option. Thanks again.
Foolishguy
Posts: 14
Joined: 09 Sep 2017, 03:30

Re: Eject() - For CD/DVD and USB Mass Storage devices

21 Sep 2017, 10:05

Hey SKAN or whomever this may concern.
I am having problems using this script to eject my External Hard-drive..
What I've done is replace DRV with X (the name of my EHDD) and it did not work..
I would like to know how this works please..
User avatar
SKAN
Posts: 310
Joined: 29 Sep 2013, 16:58

Re: Eject() - For CD/DVD and USB Mass Storage devices

21 Sep 2017, 12:17

What I've done is replace DRV with X (the name of my EHDD) and it did not work..
I would like to know how this works please..


Try this:


What does the MsgBox show?

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Kellyzkorner_NJ and 10 guests