DX
from
WinCustomize Forums
Having a little problem with VB script. I've checked two sources fo VB script samples and no luck (including MS VB script reference) The code is:
("Sub Object_OnScriptEnter
Set filesys = CreateObject("Scripting.FileSystemObject")
Set drv = filesys.GetDrive("C:")
Set MyDrivestate = drv.IsReady
Object.SetTimer 12345, 500
End Sub
Sub Object_OnTimer12345
If MyDrivestate Then
Object.State = "Ready"
Else
Object.State = "Busy"
End If
End Sub
'Called when the script is terminated
Sub Object_OnScriptExit
Object.KillTimer 12345
End Sub")
This bombs on line 4 where I attempt to Set MyDriveState it doesn't treat drv as an object. Trying to reference drv with DesktopX.Object("drv").IsReady doesn't work comes back invalid as does DesktopX.ScriptObject("drv").IsReady. So it seems the Drive object in VB script isn't working for me or I don't know DesktopX's syntax for this. Anyone know a solution for this?
("Sub Object_OnScriptEnter
Set filesys = CreateObject("Scripting.FileSystemObject")
Set drv = filesys.GetDrive("C:")
Set MyDrivestate = drv.IsReady
Object.SetTimer 12345, 500
End Sub
Sub Object_OnTimer12345
If MyDrivestate Then
Object.State = "Ready"
Else
Object.State = "Busy"
End If
End Sub
'Called when the script is terminated
Sub Object_OnScriptExit
Object.KillTimer 12345
End Sub")
This bombs on line 4 where I attempt to Set MyDriveState it doesn't treat drv as an object. Trying to reference drv with DesktopX.Object("drv").IsReady doesn't work comes back invalid as does DesktopX.ScriptObject("drv").IsReady. So it seems the Drive object in VB script isn't working for me or I don't know DesktopX's syntax for this. Anyone know a solution for this?