• psmgx@lemmy.world
    link
    fedilink
    English
    arrow-up
    24
    ·
    1 month ago

    Find some random batch file on the early internet.

    Cup holder script… Say fuck it, download and run.

    CD ROM opens. No other functions, miners, or Trojans. Peak Geocities.

  • SzethFriendOfNimi@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    1 month ago

    https://stackoverflow.com/questions/58670/windows-cdrom-eject

    C function

    bool ejectDisk(TCHAR driveLetter)
    {
      TCHAR tmp[10];
      _stprintf(tmp, _T("\\\\.\\%c:"), driveLetter);
      HANDLE handle = CreateFile(tmp, GENERIC_READ, FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
      DWORD bytes = 0;
      DeviceIoControl(handle, FSCTL_LOCK_VOLUME, 0, 0, 0, 0, &bytes, 0);
      DeviceIoControl(handle, FSCTL_DISMOUNT_VOLUME, 0, 0, 0, 0, &bytes, 0);
      DeviceIoControl(handle, IOCTL_STORAGE_EJECT_MEDIA, 0, 0, 0, 0, &bytes, 0);
      CloseHandle(handle);
      return true;
    }
    
  • shalafi@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 month ago

    Had one called Coke.exe with a Coke bottle icon. Set it to pop the accountants CD on a random timer. She thought she was going nuts.