Open close CD ROM for desired pc - UPDATED

Get help on programming - C++, Java, Delphi, etc.
Frozenfireside
Registered User
Posts: 2618
Joined: 26 Apr 2007, 02:00
Location: Westcliff, Johannesburg
Contact:

Post by Frozenfireside »

Open the door of J: CD-ROM drive nircmd.exe cdrom open j:
Close the door of Y: CD-ROM drive nircmd.exe cdrom close y:

http://www.nirsoft.net/utils/nircmd.html
install the nircmd first though.

Additional commands:
Increase the system volume by 2000 units (out of 65535) nircmd.exe changesysvolume 2000
Decrease the system volume by 5000 units (out of 65535) nircmd.exe changesysvolume -5000
Set the volume to the highest value nircmd.exe setsysvolume 65535
Mute the system volume nircmd.exe mutesysvolume 1
Unmute the system volume nircmd.exe mutesysvolume 0
Switch the system volume between the mute and normal state. nircmd.exe mutesysvolume 2
Create a shortcut on your desktop that switch the system volume between the mute and normal state. nircmd.exe cmdshortcut "~$folder.desktop$" "Switch Volume" mutesysvolume 2
Turn off the monitor nircmd.exe monitor off
Start the default screen saver nircmd.exe screensaver
Put your computer in 'standby' mode nircmd.exe standby
log off the current user nircmd.exe exitwin logoff
Ask if you want to reboot, and if you answer 'Yes', reboot the computer. nircmd.exe qboxcom "Do you want to reboot ?" "question" exitwin reboot
Turn off your computer nircmd.exe exitwin poweroff
Turn off all computers specified in computers.txt ! multiremote copy "c:\temp\computers.txt" exitwin poweroff force
Dial to "My Internet" connection nircmd.exe rasdial "My Internet"
Disconnect the "My Internet" connection nircmd.exe rashangup "My Internet"
Make your Internet Explorer windows 75% transparent ! (192 / 256) nircmd.exe win trans ititle "internet explorer" 192
Minimize all your Internet Explorer windows nircmd.exe win min class "IEFrame"
Close all your Internet Explorer windows nircmd.exe win close class "IEFrame"
Close all your Explorer windows (My Computer, folders, and so on) nircmd.exe win close class "CabinetWClass"
Hide all your Internet Explorer windows nircmd.exe win hide class "IEFrame"
Show all your Internet Explorer windows (after you made them hidden with previous example) nircmd.exe win show class "IEFrame"
Center all top-level windows nircmd.exe win center alltop
Remove the title bar of My Computer window. nircmd.exe win -style title "my computer" 0x00C00000
Return the title bar of My Computer window that we removed in the previous example. nircmd.exe win +style title "my computer" 0x00C00000
Set the My Computer window to right-to-left order (For hebrew and arabic languages) nircmd win +exstyle title "my computer" 0x00400000
Set all child windows of My Computer window to right-to-left order (For hebrew and arabic languages) nircmd win child title "my computer" +exstyle all 0x00400000
Create a shortcut on your desktop that closes all your Internet Explorer windows nircmd.exe cmdshortcut " "~$folder.desktop$ "Close All IE" win close class "IEFrame"
Create a shortcut on your desktop that hides all your Internet Explorer windows nircmd.exe cmdshortcut " "~$folder.desktop$ "Hide All IE" win hide class "IEFrame"
Create a shortcut on your desktop that shows back all your Internet Explorer windows nircmd.exe cmdshortcut " "~$folder.desktop$ "Show All IE" win show class "IEFrame"
Set the Windows Calculator as top-most window (above all other windows) nircmd.exe win settopmost title "Calculator" 1
Set the Windows Calculator back to regular window (non top-most window) nircmd.exe win settopmost title "Calculator" 0
Create a shortcut to Windows calculator under Start Menu->Programs->Calculators nircmd.exe shortcut "f:\winnt\system32\calc.exe" "~$folder.programs$\Calculators" "Windows Calculator"
Hide the desktop window nircmd.exe win hide class progman
Show the desktop window (After hiding it in previous example) nircmd.exe win show class progman
Hide the start button on the system tray nircmd.exe win child class "Shell_TrayWnd" hide class "button"
Show the start button on the system tray nircmd.exe win child class "Shell_TrayWnd" show class "button"
Hide the clock on the system tray nircmd.exe win child class "Shell_TrayWnd" hide class "TrayClockWClass"
Show the clock on the system tray nircmd.exe win child class "Shell_TrayWnd" show class "TrayClockWClass"
Kill (terminate) all instance of Internet Explorer processes nircmd.exe killprocess iexplore.exe
Create a shortcut on your desktop that opens the door of K: CDROM drive when you run it. nircmd.exe cmdshortcut "~$folder.desktop$" "Open CDROM" cdrom open k:
Create a shortcut to NirSoft Web site on your desktop nircmd.exe urlshortcut "http://www.nirsoft.net" "~$folder.desktop$" "NirSoft"
Add NirSoft Web site to your Favorities under Links folder. nircmd.exe urlshortcut "http://www.nirsoft.net" "~$folder.favorites$\Links" "NirSoft"
Create a shortcut to NirSoft Web site on the desktop of all computers listed in computers.txt nircmd.exe multiremote copy "c:\temp\computers.txt" urlshortcut "http://www.nirsoft.net" "~$folder.common_desktop$" "NirSoft"
Set the display mode to 800x600x24bit colors nircmd.exe setdisplay 800 600 24
Create a shortcut on the desktop that set the display mode to 800x600x24bit colors nircmd.exe cmdshortcut "~$folder.desktop$" &quot800x600x24" setdisplay 800 600 24
Copy all shortcuts on your desktop to another folder (f:\temp\desktop). nircmd.exe execmd copy "~$folder.desktop$\*.lnk" f:\temp\desktop
Restart your Apache server (under Windows NT/2000/XP/2003) nircmd.exe service restart apache
Create a shortcut on your desktop that restarts the Apache server nircmd.exe cmdshortcut "~$folder.desktop$" "Restart Apache" service restart apache
Restart your IIS nircmd.exe service restart w3svc
Restart MySql nircmd.exe service restart MySql
Open the desired Registry key/value in RegEdit nircmd.exe regedit "HKLM\Software\Microsoft\Windows\CurrentVersion" "CommonFilesDir"
Open the Registry key that you copied to the clipboard in RegEdit. nircmd regedit "~$clipboard$"
Disable the screen saver nircmd.exe regsetval sz "HKCU\control panel\desktop" "ScreenSaveActive" 0
Enable the screen saver nircmd.exe regsetval sz "HKCU\control panel\desktop" "ScreenSaveActive" 1
Change the date/time of the specified filename (creation time and modified time) nircmd.exe setfiletime "c:\temp\myfile.txt" "24-06-2003 17:57:11" "22-11-2005 10:21:56"
Copy your desktop folder path to the clipboard nircmd.exe clipboard set ~$folder.desktop$
Copy your start menu folder path to the clipboard nircmd.exe clipboard set ~$folder.start_menu$
Copy the content of info1.txt (simple text file) to the clipboard nircmd.exe clipboard readfile "c:\My Files\info1.txt"
Add the text content of clipboard to info1.txt nircmd.exe clipboard addfile "c:\My Files\info1.txt"
Clear the clipboard nircmd.exe clipboard clear
Create all folders specified in "c:\temp\folders.txt". The folder path names are separated by CRLF characters. nircmd.exe paramsfile "c:\temp\folders.txt" "" "" execmd md ~$fparam.1$
Install the specified .NET assembly in the global assembly cache (like gacutil) nircmd.exe gac install "C:\temp\MyAssembly\bin\MyAssembly.dll"
Empty the recycle bin in all drives. nircmd.exe emptybin
Answer 'Yes' to a standard Windows message-box. nircmd.exe dlg "" "" click yes
Wait 2 seconds, and then save the current screen to shot.png nircmd.exe cmdwait 2000 savescreenshot "f:\temp\shot.png"
Soon Google will know everything...including how to divide by zero :(
Image
UrBaN
Registered User
Posts: 12811
Joined: 02 Feb 2005, 02:00
Location: JHB East
Contact:

Post by UrBaN »

useful utility, but that's for local drives is it not?

May well work for a mapping to a shared drive though...

ill try quick
Image
to ápeiro anima
PHR33K
Registered User
Posts: 779
Joined: 05 Sep 2004, 02:00
Contact:

Post by PHR33K »

have a look through milw0rm for remote-code-execution vulnerabilities for known applications. Then you might need to code a bit of shellcode (but I think milw0rm has a good collection of that too) to open/close the cd drive. but if not, if you find a vulnerability give send me a pm and I'll help you out.
Frozenfireside
Registered User
Posts: 2618
Joined: 26 Apr 2007, 02:00
Location: Westcliff, Johannesburg
Contact:

Post by Frozenfireside »

Right I am recalling this necro post to have some of my own fun.

We have all created Server 2003 computers using Virtual PC and I have been playing around however I have run into a few snags.

I want to enable the messenger service of a target machine and I have the admin user name and password but I lack the command.

Net Start messenger etc-Now to get it to target a PC with user name and password added for access.

I want to create a batch file that repeats the command X number of times (I think you can see where I'm going with this).
repeat for X number of times (all I could think of from Turbo Pascal days)

I have full access to the command prompt and I can run batch files even on the original non virtual PC based network so I am going to have some fun.

I will post any solutions I find here for others to use :)
Soon Google will know everything...including how to divide by zero :(
Image
UrBaN
Registered User
Posts: 12811
Joined: 02 Feb 2005, 02:00
Location: JHB East
Contact:

Post by UrBaN »

I would appreciate that very much :D :twisted:

I tried the shutdown -m \\username command but had no luck. :(
Image
to ápeiro anima
endev8003
Registered User
Posts: 382
Joined: 02 May 2005, 02:00
Location: Bryanston
Contact:

Post by endev8003 »

It's actually shutdown -m \\computername

You use the pc's network name, not the username. That might be why it is not working.

SilverBack
Someone suggested using dameware. I haven't taken a look at it yet, so I'm not sure it will work. They guy said that you don't need a server program or service on the target computer, nut you probably need admin user rights.
Vampyre_2099
Registered User
Posts: 1321
Joined: 04 Nov 2007, 02:00
Location: /home/jhb/fourways

Post by Vampyre_2099 »

UrBaN wrote:net send username message
ie.

net send djt stop piccking ur nose...

username can be PC name or IP address.

Doesn't work on XP though.
I'm sure it runs on XP. I used to use it
mybrute
myminicity
PCformat ZA Folding Stats

ImageImage
Spoiler: (show)
Desktop: Q8200 @ 2.33GHz ~ TRUE ~ DP35DP ~ 4GB Transcend Jetram RAM ~ Nvidia 8800GT ~ 250GB HDD
Notebook: T5550 @ 1.83GHz ~ 2GB RAM ~ ATI HD 2400 XT ~ 160GB HDD
endev8003
Registered User
Posts: 382
Joined: 02 May 2005, 02:00
Location: Bryanston
Contact:

Post by endev8003 »

It does work on XP, but I know it can be disabled. It is disabled on my employer's network. I don't know if it is enabled by default though.

My friend and myself used to send a lot of messages using net send. At first, I used to have win98, and you needed to run winpopup before you could send or receive messages.
UrBaN
Registered User
Posts: 12811
Joined: 02 Feb 2005, 02:00
Location: JHB East
Contact:

Post by UrBaN »

Hmm ok my bad, pls tell me how to enable it on XP then, I can't use Google because this one time, at band camp...Well jamin gatecrashed and it's been dodgy ever since.

@ Endev: I meant computername, not username - just a typo. But I found a good writeup of how to enable it, will post tomorrow.
Image
to ápeiro anima
Frozenfireside
Registered User
Posts: 2618
Joined: 26 Apr 2007, 02:00
Location: Westcliff, Johannesburg
Contact:

Post by Frozenfireside »

It does work on XP, but I know it can be disabled
The messenger service needs to be enabled but it is disabled by default for security reasons, hence I need 'net start messenger' but over a network.

I now need a repeat command to send 100 000 irritating messages to my mate.

Try it now

:D
Soon Google will know everything...including how to divide by zero :(
Image
UrBaN
Registered User
Posts: 12811
Joined: 02 Feb 2005, 02:00
Location: JHB East
Contact:

Post by UrBaN »

I r enabled it :D It won't let me send messages to my bro, but because it his PC is off and I have removed his RAM..I can live with it. It is only Windows after all :lol:
Image
to ápeiro anima
PHR33K
Registered User
Posts: 779
Joined: 05 Sep 2004, 02:00
Contact:

Post by PHR33K »

What OS are these computers running?
Frozenfireside
Registered User
Posts: 2618
Joined: 26 Apr 2007, 02:00
Location: Westcliff, Johannesburg
Contact:

Post by Frozenfireside »

Shut down multiple computers:
SHUTDOWN -i
Soon Google will know everything...including how to divide by zero :(
Image
UrBaN
Registered User
Posts: 12811
Joined: 02 Feb 2005, 02:00
Location: JHB East
Contact:

Post by UrBaN »

XP Pro
Image
to ápeiro anima
SilverBack
Registered User
Posts: 1387
Joined: 26 Jan 2006, 02:00
Location: JHB
Contact:

Post by SilverBack »

Sweet...thanks for all the info dudes! Gonna give them a bash. Murphies law...just when I had time to "play"...work creeps in. Im now swamped with work...so gonna have to put this off for a little while.

Let me know what you guys find. Will check back here when I can. :?
Deja Moo: The feeling that you've heard this bull before.
Hire A Programmer -|- Just Source Code Blog
UrBaN
Registered User
Posts: 12811
Joined: 02 Feb 2005, 02:00
Location: JHB East
Contact:

Post by UrBaN »

UrBaN wrote: But I found a good writeup of how to enable it, will post tomorrow.
Clickity Click, then scroll down and click on REMOTE ADMINISTRATION ON XP PRO
Image
to ápeiro anima
SBSP
Registered User
Posts: 3124
Joined: 09 May 2006, 02:00
Location: Centurion

Post by SBSP »

If you have admin rights

you could remotely send a schedule task that will launch you CDROM open/close program.

Search google on how to use the AT command for schedule tasks.


Or if you know how to use winsock use that to trigger and open the CDrom.
Frozenfireside
Registered User
Posts: 2618
Joined: 26 Apr 2007, 02:00
Location: Westcliff, Johannesburg
Contact:

Post by Frozenfireside »

The first question we need to ask: How can we stop or start a service remotely?

One way is to use the GUI. The service manager I showed you before can connect to a remote computer. Using this method it takes three clicks and about 45 seconds. 45 Seconds x 400 machines = about 5 hours of lots of clicking.

We definitely want to use the command line for this one.

Microsoft has a utility in the resource kit for Windows XP professional named (sc.exe)

It follows this syntax:

sc.exe computername action service_name

It lets you start and stop services of a remote computer from the command line. Now we are on the right track. Still...I don't like the way this program operates. The major feature it is missing is authentication. I want to provide a username and password all in the same command line tool.

I took the liberty to create such a tool. (Free) It can be downloaded from here

It follows this syntax:

RemoteService.exe HOST ACTION SERVICENAME [USERNAME] [PASSWORD]

Possible actions are: STOP, or START

Username and password are optional.
For the SC.exe command try the 'run as' option and enter in the target PCs admin details.

for a repeat command that never stops try this
set count=
:loop
set count=%count%*
net send ed-pc hello
if not %count%==********** goto loop
Soon Google will know everything...including how to divide by zero :(
Image
SilverBack
Registered User
Posts: 1387
Joined: 26 Jan 2006, 02:00
Location: JHB
Contact:

Post by SilverBack »

Ok, so I coded a open close app. Simple, easy. Found a MS tool called PSexec...comes with PsTools. Now the nice thing about this utility is you can run any file on a remote pc as if you were on the pc itself. So...I copied my exe to a windows folder (so they wont find it :twisted: ) and then I use PSExec to run the file on the users pc.

The result...cdrom opens then closes. Had some fun yesterday. Only thing that needs updating is the app needs to read waht drive the Cd Rom is on. One guy has his CD Rom as his "G:\" drive...so the app didnt pick it up (defaults to D). So...just need to update it to read all CD Rom drives on the users pc.

Wher can I upload the source code for those interested? BTW...recon this is a cool little app...couldnt find one on the net that works simple like this...pitty its in 2 parts (the EXE and then using the PSExec tool), but still...its simple, so thats what I was looking for ;)
UrBaN
Registered User
Posts: 12811
Joined: 02 Feb 2005, 02:00
Location: JHB East
Contact:

Post by UrBaN »

I r need it :D

could you email it?
Image
to ápeiro anima
DJT
I Bribed Ron With Foundry And All I Got Was This Lousy Title
Posts: 9387
Joined: 09 Aug 2002, 02:00
Location: Locked Down
Contact:

Post by DJT »

Yip, email me too plz
Want to support my creative work? Drop me a like and subscribe below. It will be greatly appreciated!
Clarke Media - YouTube Channel
Clarke Media - Facebook
SilverBack
Registered User
Posts: 1387
Joined: 26 Jan 2006, 02:00
Location: JHB
Contact:

Post by SilverBack »

NP...gonna do the update first to check for all CDROM drives on a users pc. Will upload to some website for source code and give the link ;)
Frozenfireside
Registered User
Posts: 2618
Joined: 26 Apr 2007, 02:00
Location: Westcliff, Johannesburg
Contact:

Post by Frozenfireside »

Respect thrown in copious amounts towards Silverback :)
Soon Google will know everything...including how to divide by zero :(
Image
UrBaN
Registered User
Posts: 12811
Joined: 02 Feb 2005, 02:00
Location: JHB East
Contact:

Post by UrBaN »

Uberrespect. Now where's the linky? lol
Image
to ápeiro anima
SilverBack
Registered User
Posts: 1387
Joined: 26 Jan 2006, 02:00
Location: JHB
Contact:

Post by SilverBack »

LOL! Sorry guys...I go through busy patches where I have NO time...and not so busy patches where I have very little time (to check back here in my breaks)...will post linky as soon as I can once the update is done. ;)
Post Reply