Jump to content

Auto Launch CD on remoted station


Recommended Posts

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.
Link to post
Share on other sites
  • Moderators

Hi, Jdelaney. Are you running the script FROM the remote PC, or using the script itself to execute remote commands through something like psexec?

"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!

Link to post
Share on other sites
  • Moderators

Please post your script (or a working reproducer) so we can assist :oops: Are you using RDP, or some other remote tool?

"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!

Link to post
Share on other sites

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.
Link to post
Share on other sites
  • Moderators

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!

Link to post
Share on other sites

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.
Link to post
Share on other sites

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...