Sign in to follow this  
Followers 0
mesale0077

diver info(external or flash disk )

5 posts in this topic

#1 ·  Posted (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 by mesale0077

Share this post


Link to post
Share on other sites



#2 ·  Posted (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'

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
Edited by rajeshontheweb

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by mesale0077

Share this post


Link to post
Share on other sites

hi

this code? whats the problem

why dont work?

thank you for help

Share this post


Link to post
Share on other sites

hi

this code ,dont work,why?

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