remotely eject a list of cd drives

hi there

i find that sometimes i have to have a datacenter employee go reboot a server... and he can't tell which one i want.

i'd like to be able to run a batch file from the domain controller, to eject all the cd drives of a list of servers except whichever one i comment out

i can address the servers by netbios name, like, \\server01

what's the easiest way to get them all ejected?

yes i could just go there and put stickers on them, but that would be too - analog... i would like a more digital solution than something as archaic as paper stickers :)
LVL 24
B HAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slemmesmiCommented:
Dear bryon44035v3,

if you have VBscript enabled on your servers, you can use the following (from http://www.tomshardware.co.uk/forum/154492-35-small-script-batch-file-open-drive-door):

*begin*
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
End If

Set oWMP = Nothing
Set colCDROMs = Nothing
*end*

Save this as a script (e.g. OpenCD.vbs) on each server.
Now you can use PSTools to remote execute.

P.S. AntiVirus on the servers may however detect the script as contains the "Joke-EjectCD Joke". Hence you may want to exclude that.

Kind regards,
Soren
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
B HAuthor Commented:
so i guess if i save that as a file.vbs, i would run something like:
psexec \\server c:\file.vbs
?

0
slemmesmiCommented:
Dear bryon44035v3,

just come to think of it - you obviously when want to do the above must consider:

1. What if a server is using the CD drive when I want to (from remote) open it's CD drive?
2. Is there free space to open the CD drive of all servers (e.g. if a server is in a rack and the front door is closed)?

I'd recommend the "analog" solution anytime/anyway - label each server.

Kind regards,
Soren
0
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

slemmesmiCommented:
Dear bryon44035v3,

yes to your question about psexec.

Kind regards,
Soren
0
B HAuthor Commented:
i wonder if i stick the vbs file in a shared folder, can i psexec the other machines to execute it?
0
B HAuthor Commented:
the servers are all 1u in size, and as such have the mini cd tray like laptops, so they only eject about an inch

one of these days i'll make the drive out there to label them - one last adjustment to the question:

what's the psexec format to call a list of netbios names without waiting for each one to finish (something about @list and /d)
0
B HAuthor Commented:
this is perfect, thanks
0
slemmesmiCommented:
Yes you can use the @file, or eventually psexec [\\computer[,computer2[,...]

The "-d" moves forward without awaiting returncode.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Legacy OS

From novice to tech pro — start learning today.