stuka Posted March 14, 2008 Share Posted March 14, 2008 (edited) . Edited August 23, 2009 by stuka Link to comment Share on other sites More sharing options...
Aceguy Posted March 14, 2008 Share Posted March 14, 2008 (edited) $var = DriveGetDrive("REMOVABLE") will detect A: drive so:- $var = DriveGetDrive("REMOVABLE") if $var = 'A:' then ;do whatever endif Edited March 14, 2008 by Aceguy [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
d4rk Posted March 14, 2008 Share Posted March 14, 2008 2, i think you can identify a floppy by its small space (1.44 MB) $drive=DriveGetDrive("REMOVABLE") $space = DriveSpaceTotal( $drive) if $space< 2 then ;anything here endif [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys Link to comment Share on other sites More sharing options...
JayMan Posted March 14, 2008 Share Posted March 14, 2008 I might be over simplifying this... But 99.9% of floppy drives out there with be assigned to A:\... and 99.9% of A:\ drives will be floppy drives... So... if DriveGetType("A:") returns anything... then ya have a floppy drive... if it returns nothing... then ya don't have a floppy drive... JayMan Link to comment Share on other sites More sharing options...
MHz Posted March 14, 2008 Share Posted March 14, 2008 But i still think DriveGetDrive=("Floppy") would be a great idea if it existed Drive letters A: & B: are reserved for floppy drives. You may be able to code for those 2 drives and ensure that they are in a ready state. Link to comment Share on other sites More sharing options...
JayMan Posted March 14, 2008 Share Posted March 14, 2008 Prior to Vista i'd agree with you... However in Vista you can assign B:\ to other devices (my burner is B:\), i'd suspect A:\ could be done also... JayMan Link to comment Share on other sites More sharing options...
ChrisL Posted March 14, 2008 Share Posted March 14, 2008 (edited) This works for me, it's quite crude really... #include<string.au3> For $i = 65 to 90 $key = Regread("HKLM\System\MountedDevices","\DosDevices\" & Chr($i) & ":") If StringInStr(_HexToString(StringReplace ($key, "00", "")),"Floppy") and DriveStatus( Chr($i) & ":\" ) <> "INVALID" Then Msgbox(0,"",Chr($i) & ": is a floppy drive") Next Edit: Variation on a theme! $var = DriveGetDrive ( "ALL" ) If NOT @error Then For $i = 1 to $var[0] $key = Regread("HKLM\System\MountedDevices","\DosDevices\" & $var[$i]) If StringInStr(_HexToString(StringReplace ($key, "00", "")),"Floppy") Then Msgbox(0,"",$var[$i] & " is a floppy drive") Next EndIf Edited March 14, 2008 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
ChrisL Posted March 14, 2008 Share Posted March 14, 2008 A combination of the 2 While 1 $var = DriveGetDrive ( "ALL" ) If NOT @error Then For $i = 1 to $var[0] $key = Regread("HKLM\System\MountedDevices","\DosDevices\" & $var[$i]) If StringInStr(_HexToString(StringReplace ($key, "00", "")),"Floppy") and DriveGetFileSystem( $var[$i]) <> "" Then Exit Msgbox(0,"",$var[$i] & " is a loaded floppy drive") Next Sleep(250) EndIf WEnd On my laptop it doesn't make the sound until a floppy is inserted ( and only the fist time ) but with this being a USB external I think the disk notification is handled by the drive. I'm not sure if that will be the case on a standard internal one [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
ChrisL Posted March 14, 2008 Share Posted March 14, 2008 (edited) Your script exits after determining if a floppy exists or is plugged in? It doesn't continue looping after that?Maybe that's why the sound came on once only?What about the DriveGetFileSystem example i gave?I think I have to rush over to my friend's place tomorrow if all fails ...he has an internal floppy driveNo it's not that, if I run the script again after taking the floppy out it doesn't make the sound again.. I'm not that stupid!I just wrote that in as a way of exiting, it's only an example. The sound only happened once full stop so no it didn't do it with yours either but like I said that maybe because its an external USB Edited March 14, 2008 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
ChrisL Posted March 14, 2008 Share Posted March 14, 2008 yes when I change the path to A: it did... however I've just been upstairs and fired up my tower and the function DriveGetFileSystem makes the floppy grind but like I said I don't think internals handle the notification they actually have to check It is only a very quick grind but I guess it depends how frequently you are going to poll [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
GEOSoft Posted March 14, 2008 Share Posted March 14, 2008 (edited) $dList = DriveGetDrive("Removable") For $I = 1 To Ubound($dList) -1 If _DriveIsFloppy($dList[$I]) = 1 Then MsgBox(0, "Test", "Drive " & StringUpper($dList[$I]) & " is a floppy drive.") Next Func _DriveIsFloppy($Drive, $Computer = ".") $Drive = StringReplace($Drive, "\", "") Local $colItems = "" $objWMIService = ObjGet("winmgmts:\\" & $Computer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_LogicalDisk WHERE MediaType = '5'", "WQL", 0x30) If IsObj($colItems) then For $objItem In $colItems If $objItem.DeviceID = $Drive Then Return 1 Else Return 0 EndIf Next Endif EndFunc Edited March 14, 2008 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
ChrisL Posted March 15, 2008 Share Posted March 15, 2008 (edited) Does checking drive A: 's total space produce grinding noises(attempt to access) from the drive? I think everyything that wants anything from Drive A: is going to do it becuase unless it's like my USB drive it lust has to keep physicaly spinning up the disk to checkEdit: I was going to change lust to just but I don't think I will! Edited March 15, 2008 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
ChrisL Posted March 15, 2008 Share Posted March 15, 2008 If you only need to know it's a floppy drive then use this. $var = DriveGetDrive ( "ALL" ) If NOT @error Then For $i = 1 to $var[0] $key = Regread("HKLM\System\MountedDevices","\DosDevices\" & $var[$i]) If StringInStr(_HexToString(StringReplace ($key, "00", "")),"Floppy") Then Msgbox(0,"",$var[$i] & " is a floppy drive") Next EndIf If you need to know a floppy disk is loaded I think your knackered! [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now