Sign in to follow this  
Followers 0
johns420

Lock CD/DVD

16 posts in this topic

I would like to be able to make a CD/DVD be unreadable until a correct username and password is created. I have a login script, but im not sure exactly what I would have to do in order to lock the CD/DVD until then.

Share this post


Link to post
Share on other sites



Are you saying you want access to the drive blocked before a user is authenticated?

Share this post


Link to post
Share on other sites

Are you saying you want access to the drive blocked before a user is authenticated?

Exactly. I dont want anyone who isnt authorized to access the information on the CD/DVD

Share this post


Link to post
Share on other sites

you are going to want to look into unmounting the device.... well.... thats all I can think of anyway... Im sure that the next post will be somebody proving me wrong though LOL

And the post after that will be somebody telling me to use less "..." LOL

Share this post


Link to post
Share on other sites

you are going to want to look into unmounting the device.... well.... thats all I can think of anyway... Im sure that the next post will be somebody proving me wrong though LOL

And the post after that will be somebody telling me to use less "..." LOL

What would happen if i unmounted the device and then ejected the disk? Would it leave the drive unmounted?

Share this post


Link to post
Share on other sites

yes it would physically come out of the drive if that is what you are asking. are you trying to block access to the data (soft) or block access to the disc (hard)?

Share this post


Link to post
Share on other sites

yes it would physically come out of the drive if that is what you are asking. are you trying to block access to the data (soft) or block access to the disc (hard)?

just block access to the data so a soft

Share this post


Link to post
Share on other sites

What would happen if i unmounted the device and then ejected the disk? Would it leave the drive unmounted?

I think that the disc would come out... did I misunderstand this question?

Share this post


Link to post
Share on other sites

I think that the disc would come out... did I misunderstand this question?

Yeah, i think you did lol. I know the disc would eject, my question is what would happen to the machine it was ejected from. Would the drive stay unmounted and unusable for normal user or would the drive become mounted again once my dvd is ejected

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

this may be what you are looking for here

Edited by danwilli

Share this post


Link to post
Share on other sites

this may be what you are looking for here

That doesnt sound like its what I want. Is there anyway to do a soft block? Just block unauthorized users from pulling any data from the drive?

Share this post


Link to post
Share on other sites

OK, you could make the disc drive empty. Then add a recurring loop with a couple of functions, that will keep the disc drive shut, then add a hotkey for an inputbox and ask for a password. If its correct, "unlock the drive".

Share this post


Link to post
Share on other sites

OK, you could make the disc drive empty. Then add a recurring loop with a couple of functions, that will keep the disc drive shut, then add a hotkey for an inputbox and ask for a password. If its correct, "unlock the drive".

That sounds more like what I would want. How would I go about doing that?

Share this post


Link to post
Share on other sites

Something like:

#include <Misc.au3>
#include <String.au3>

HotKeySet("{F8}", "CDPass")
HotKeySet("{F9}", "CDFunc")

Global $File = @ScriptDir & '\password.ini'
Global $Encryption = "S4DC3"
Global $Drive = DriveGetDrive("CDROM")
Local $Locked = False

If Not _Singleton("CDL0CK", 1) Then
    MsgBox(262144, "Error", "CD Locker is already running!")
    Exit
EndIf

While 1
    Sleep(100)
    If $Locked = False Then
        CDTray($Drive, "open")
    ElseIf $Locked = True Then
        CdTray($Drive, "closed")
    EndIf
Wend

Func CDFunc()
    $OpenCD = InputBox("Password", "Please enter password, to unlock CD Drive:", "", "*")
    $Decrypted = _StringEncrypt(0, $OpenCD, $Encryption)
    $PassCheck = IniReadSection($File, "Password")
    If $PassCheck = $Decrypted Then
        MsgBox(4096, "CDLocker", "CD Draw unclocked!")
        $Locked = False
    ElseIf @error Then
        MsgBox(16, "CDLocker", "Invalid password!")
        Do
            $Locked = True
        Until $OpenCD = $Decrypted
    EndIf
EndFunc

Func CDPass()
    $Password = InputBox("Password", "Please specify a password:", "", "*")
    $Encrypted = _StringEncrypt(1, $Password, $Encryption)
    IniWrite($File, "Password", "Password", $Encrypted)
    MsgBox(4096, "Completed", "New password, saved and encrypted!")
EndFunc

I only made it quickly. I know it doesn't work. I made it a while ago, then I went ill and forgot about it. Try fix it up.

Share this post


Link to post
Share on other sites

Something like:

#include <Misc.au3>
#include <String.au3>

HotKeySet("{F8}", "CDPass")
HotKeySet("{F9}", "CDFunc")

Global $File = @ScriptDir & '\password.ini'
Global $Encryption = "S4DC3"
Global $Drive = DriveGetDrive("CDROM")
Local $Locked = False

If Not _Singleton("CDL0CK", 1) Then
    MsgBox(262144, "Error", "CD Locker is already running!")
    Exit
EndIf

While 1
    Sleep(100)
    If $Locked = False Then
        CDTray($Drive, "open")
    ElseIf $Locked = True Then
        CdTray($Drive, "closed")
    EndIf
Wend

Func CDFunc()
    $OpenCD = InputBox("Password", "Please enter password, to unlock CD Drive:", "", "*")
    $Decrypted = _StringEncrypt(0, $OpenCD, $Encryption)
    $PassCheck = IniReadSection($File, "Password")
    If $PassCheck = $Decrypted Then
        MsgBox(4096, "CDLocker", "CD Draw unclocked!")
        $Locked = False
    ElseIf @error Then
        MsgBox(16, "CDLocker", "Invalid password!")
        Do
            $Locked = True
        Until $OpenCD = $Decrypted
    EndIf
EndFunc

Func CDPass()
    $Password = InputBox("Password", "Please specify a password:", "", "*")
    $Encrypted = _StringEncrypt(1, $Password, $Encryption)
    IniWrite($File, "Password", "Password", $Encrypted)
    MsgBox(4096, "Completed", "New password, saved and encrypted!")
EndFunc

I only made it quickly. I know it doesn't work. I made it a while ago, then I went ill and forgot about it. Try fix it up.

Thanks for the start. I will let you know how it goes.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0