Author Topic: Spin down and safely eject a USB hard disk  (Read 315 times)

SimplySimon

  • Newbie
  • *
  • Posts: 1
Spin down and safely eject a USB hard disk
« on: January 02, 2018, 06:17:59 am »
I am very new, so if this subject has been dealt with please feel free to point me in the right direction,

I am looking at doing two things:

1 writing a script that will copy files to a hard disk connected by USB to Port_#0002 Drive letter e:

2 when the files have been copied, to power or spin down the drive and safely eject it.

I have used
DiskScan(64 ) which lists the drive
xEjectMedia("e:") which does nothing except returning 1 which I assume is success, but as this is not a CD or Jaz drive nothing happens.

Any pointers would be good

Simon

td

  • Tech Support
  • *****
  • Posts: 2474
    • WinBatch
Re: Spin down and safely eject a USB hard disk
« Reply #1 on: January 02, 2018, 07:14:40 am »
In testing, xEjectMedia generally does eject USB drives.  However, USB drives often do not "spin down" because they are ejected.    You have to either physically turn them off or unplug them in most cases.  Also, don't confuse the state of the media with the presence of the icon in the notification area of the taskbar.   xEjectMedia uses the same method used by the Windows shell.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates