Jump to content

Recommended Posts

Posted (edited)

This probably is more of a windows question, but related to a script I'm running. When I'm remoted into my computer, and load a CD (mounting an ISO, or opening and closing the CDTray), windows does not auto-launch the application on the disk. When I am logged in directly, it does. Any ideas to workaround that?

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Posted (edited)

Yes, MSTSC(RDP)...script (simplified to only do what is needed to replicate):

$WinHnd = Run ( @ComSpec )
sleep ( 5000 )
WinActivate ( $WinHnd )
Send ( "C:UsersjdelaneyDesktopcd.vbs {Enter}")

and the .vbs:

call Close ()

Sub Close()

Set oWMP = CreateObject("WMPlayer.OCX.7" )

Set colCDROMs = oWMP.cdromCollection

if colCDROMs.Count >= 1 then

For i = 0 to colCDROMs.Count - 1

colCDROMs.Item(i).Eject

Next ' cdrom

For i = 0 to colCDROMs.Count - 1

colCDROMs.Item(i).Eject

Next

End If

End Sub

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
  • Moderators
Posted

I would suggest trying with the built in CDTray function in AutoIt, and see if that works for you. That way you can at least narrow it down to the AutoIt script or your vbscript (not to mention fewer lines). Try the example in the help file and let us know if that does not work for you.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

I will, but the script functions fine, it's the system environment that seems to be the issue...everything is fine locally, when logged in, it's just teh rdp that is choking. No luck on google, but others have the same problem.

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...