Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Possible to do remotely?

Status
Not open for further replies.

Sasstraliss

Programmer
Apr 7, 2009
21
AU
This is a script for opening CD drives, is this possible to do remotely?

Code:
Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection
do
if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next
End If
wscript.sleep 5000
loop

Thanks.
 
Added as part of a login script, yes. Also using remote tools such as PSEXEC.

Another method would be to execute the script remotely if it already exists locally on the remote system.
Normally you would utilize WMI to perform remote tasks, however the Win32_CDROMDrive class does not have a method for Eject.

Some alternate code for doing this can also be found in my login script FAQ under the April Fools add-in.
faq329-5798



I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top