Disabling eject button?
Disabling eject button?
Does anyone know if there is a way to disable the eject button on a t42 cd drive? I mean the physical button, so that pressing it wouldn't cause the drive to open, but I could still go into windows explorer and right click on the drive and choose eject. The eject button is in the exact spot where I tend to grab my laptop to move it, and so at least a couple times a day I accidentally open the drive, which is just a bit annoying. Thanks in advance.
just make a short program that locks the cd drive.
here's one for linux, just compile and name as cd-lock and cd-unlock.
here's one for linux, just compile and name as cd-lock and cd-unlock.
Code: Select all
#include <sys/ioctl.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/cdrom.h>
#include <string.h>
#include <libgen.h>
int main(int argc, char *argv[])
{
int fd;
int lock;
char *cmd1;
cmd1 = basename(argv[0]);
if (!strcmp(cmd1, "cd-lock"))
lock = 1;
else if (!strcmp(cmd1, "cd-unlock"))
lock = 0;
else {
printf("program must be called cd-lock or cd-unlock\n");
return 1;
}
if (argc != 2)
fd = open("/dev/hdc", O_RDONLY | O_NONBLOCK);
else
fd = open(argv[1], O_RDONLY | O_NONBLOCK);
if ( fd < 0 )
{
perror("open failed");
return 3;
}
if (ioctl(fd, CDROM_LOCKDOOR, lock)) {
perror("ioctl failed");
return 4;
}
return 0;
}-
- Similar Topics
- Replies
- Views
- Last post
-
-
Disabling Thinkpad Security Features
by ThorOfAsgard » Fri May 19, 2017 6:43 am » in GENERAL ThinkPad News/Comments & Questions - 7 Replies
- 306 Views
-
Last post by shawross
Fri May 19, 2017 6:51 pm
-
-
- 7 Replies
- 1702 Views
-
Last post by Metallo
Tue Jan 31, 2017 6:47 pm
-
-
IBM- Lenovo T61- how to run the ThinkVantage button
by Radovan-kocour » Sun Mar 12, 2017 3:19 pm » in ThinkPad T6x Series - 1 Replies
- 925 Views
-
Last post by RealBlackStuff
Mon Mar 13, 2017 4:27 am
-
-
-
Thinkpad 365XD left and right clicker button repair
by TMac365 » Sun Mar 12, 2017 6:26 pm » in ThinkPad Legacy Hardware - 3 Replies
- 1493 Views
-
Last post by rkawakami
Mon Mar 13, 2017 5:15 pm
-
Who is online
Users browsing this forum: No registered users and 4 guests




