VB Scripting?

bystander

Regular
Does anyone know any good VB Scripting/Windows Scripting Host tutorial sites? I'm trying to use Windows Scripting Host to do the following:

What I'm trying to do is to determine when all open file handles to a removable drive/flash drive are closed and then eject the removable device/flash drive when this situation occurs. I don't know if it is entirely possible to do through the Windows Scripting Host via VB Script, so if you suggest an alternative method that's fine as well.

I've managed to find some code required to eject a drive:

Code:
/* eject.js */ 
drive=WScript.Arguments(0).replace(/^([a-z]):?\\?$/ig,"$1:\\"); 

var Shell= new ActiveXObject("Shell.Application"); 

var ssfDrives =17; 

Shell.Namespace(ssfDrives).ParseName(drive).InvokeVerb("E&ject"); 

/* end of script */
 
Last edited by a moderator:
Back
Top