Forum Discussion
17 years ago
We were having this same problem at a client's site. I found this forum while attempting to find an answer. I finally decided to try my hand a writing a script that would handle this. We had found that stopping the "RDXMon" service allowed the drive to be ejected.
This script will stop the server "RDXMon", eject the drive (Drive letter MUST be specified in the script...change it to suit your needs), and then restart the service. Using this as a "Post-command" after the backup completes has fixed our issue...the backup completes and ejects the drive consistently. I used a batch file to call up the VBS script.
I hope this helps some of you!
Code:
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++' VBScript: AUTHOR: B.Spivey (thanatos8877 @ hotmail.com)'' SCRIPT NAME: EjectRemovableMedia.vbs'' REVISION DATE: 5/28/2008'' PURPOSE: Eject removable media'' COMMENTS: The removable hard drive RD-1000 fails to eject properly' after Symantec Backup Exec is finished backing up.'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Option ExplicitOn Error Resume NextWscript.Timeout = 3600 'Number of seconds before script times out'Declare the variablesDim strComputer, strServiceName, strDriveLetterDim objWMI, objServiceDim dDim WshShellDim strCommand'Set the String ConstantsstrComputer = "."strServiceName = "RDXMon" 'RDXMon is the service that controls the Dell RD-1000.strDriveLetter = "E:\" 'Please change the drive to suit your needs'Use WMI to stop the service listed in the String Constantsset objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")set objService = objWMI.Get("Win32_Service.Name='" & strServiceName & "'")objService.StopService'Sleep - the sleep function is in milliseconds (add 3 0's to your desired number of seconds)Wscript.Sleep(5000)'Use FSO to eject the drive listed in the String ConstantsFor Each d in CreateObject("Scripting.FileSystemObject").Drives Eject strDriveLetterNext'Sleep - the sleep function is in milliseconds (add 3 0's to your desired number of seconds)Wscript.Sleep(5000)'Use WMI to start the service listed in the String Constantsset objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")set objService = objWMI.Get("Win32_Service.Name='" & strServiceName & "'")objService.StartService Sub Eject(DRIVE) Dim ssfDrives ssfDrives = 17 CreateObject("Shell.Application")_ .Namespace(ssfDrives).ParseName(DRIVE).InvokeVerb("E&ject") End Sub
Message Edited by thanatos8877 on 06-05-2008 07:48 AM
Related Content
- 10 years ago
- 14 years ago