mesale0077 Posted September 5, 2009 Share Posted September 5, 2009 (edited) hi ,new flash disk put in the pc Extrem Hard Disk or USB Recording inthe Computer dont write info new flash disk why , info flashdisk put inthe pc ı want to make flash disk((external or flash disk) recordkeeping but dont worked code: Dim $yazildi $oldvar=DriveGetDrive("all") HotKeySet( '{esc}', "Terminate") opt("OnExitFunc", "Terminate") #NoTrayIcon $log = @ScriptDir &"/flash.txt" $var = DriveGetDrive( "all" ) if $var <> $oldvar then $degisim=1 else $degisim=0 $oldvar=$var endif $ff="" While 1 If NOT @error Then if $degisim=1 Then $yazildi=0 $degisim=0 endif FileOpen($log, 1) For $i = 1 to $var[0] If NOT @error and $var[$i] > "f" and $ff="" and $yazildi=0 Then FileWrite($log,$var[$i] &@MDAY & "." & @MON & "." & @YEAR& " " & @HOUR & ":" & @MIN & ":" & @SEC & " name: "&DriveGetLabel($var[$i] )&" Serial: " & DriveGetSerial($var[$i] ) &" total: "& Round ( DriveSpaceTotal($var[$i] ) )& @CRLF ) $gg=DriveGetLabel($var[0] ) $ff= $gg EndIf Next $yazildi=1 EndIf FileClose($log) $ff="" WEnd Func Terminate() FileClose($log) Exit EndFunc new flash dont write why? thank you for help Edited September 5, 2009 by mesale0077 Link to comment Share on other sites More sharing options...
rajeshontheweb Posted September 6, 2009 Share Posted September 6, 2009 (edited) sorry but if it is a little more explanatory , it would be helpful. to start with, please use code tags, 1 this text entry wastes space, 2 its not very readable. next, if i understand right, u want a code to log all new portable drives like hdd or flash drive to be logged, right? in that case, check the codes available here to monitor disc change activity, 'usb drive monitoring' expandcollapse popupDim $yazildi $oldvar=DriveGetDrive("all") HotKeySet( '{esc}', "Terminate") opt("OnExitFunc", "Terminate") #NoTrayIcon $log = @ScriptDir &"/flash.txt" $var = DriveGetDrive( "all" ) if $var <> $oldvar then $degisim=1 else $degisim=0 $oldvar=$var endif $ff="" While 1 If NOT @error Then if $degisim=1 Then $yazildi=0 $degisim=0 endif FileOpen($log, 1) For $i = 1 to $var[0] If NOT @error and $var[$i] > "f" and $ff="" and $yazildi=0 Then FileWrite($log,$var[$i] &@MDAY & "." & @MON & "." & @YEAR& " " & @HOUR & ":" & @MIN & ":" & @SEC & " name: "&DriveGetLabel($var[$i] )&" Serial: " & DriveGetSerial($var[$i] ) &" total: "& Round ( DriveSpaceTotal($var[$i] ) )& @CRLF ) $gg=DriveGetLabel($var[0] ) $ff= $gg EndIf Next $yazildi=1 EndIf FileClose($log) $ff="" WEnd Func Terminate() FileClose($log) Exit EndFunc Edited September 6, 2009 by rajeshontheweb Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
mesale0077 Posted September 6, 2009 Author Share Posted September 6, 2009 (edited) hi the memory card to make a list is inserted the pc external memory and flash memory I want to make a list is inserted the pc or list of installed memory(external memory and flash memory list) thank you for help Edited September 9, 2009 by mesale0077 Link to comment Share on other sites More sharing options...
mesale0077 Posted September 9, 2009 Author Share Posted September 9, 2009 hi this code? whats the problem why dont work? thank you for help Link to comment Share on other sites More sharing options...
mesale0077 Posted October 16, 2009 Author Share Posted October 16, 2009 hi this code ,dont work,why? 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