Jump to content

Buffo

Active Members
  • Posts

    112
  • Joined

  • Last visited

Buffo's Achievements

Adventurer

Adventurer (3/7)

0

Reputation

  1. Now it works with GetDriveStatus(). I don't know why it didn't work before. The drive isn't spinning up any more. Thx to the guys at German AutoIt Forum Regards, Buffo
  2. Yes, I tried but it doesn't work
  3. Yes, media is inserted.
  4. @doudou: It happens nothing if I change media or open and close my cd door My Code: #include <GUIConstants.au3> GuiCreate("", 600, 400) Const $DBT_DEVICEARRIVAL = 0x8000; system detected a new device Const $DBT_DEVICEQUERYREMOVE = 0x8001; wants to remove, may fail Const $DBT_DEVICEQUERYREMOVEFAILED = 0x8002; removal aborted Const $DBT_DEVICEREMOVEPENDING = 0x8003; about to remove, still avail. Const $DBT_DEVICEREMOVECOMPLETE = 0x8004; device is gone Const $DBT_DEVICETYPESPECIFIC = 0x8005; type specific event Const $WM_DEVICECHANGE = 0x0219 GUIRegisterMsg($WM_DEVICECHANGE, "MY_WM_DEVICECHANGE") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Wend Func MY_WM_DEVICECHANGE($hWnd, $msg, $wParam, $lParam) Switch $wParam Case $DBT_DEVICEARRIVAL MsgBox(0, "Arrival", "") Case $DBT_DEVICEREMOVECOMPLETE MsgBox(0, "Removecomplete", "") EndSwitch Return 1 EndFunc @Joon: I tried this: $oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") While 1 $oEvents = $oWMI.ExecNotificationQuery("SELECT * FROM Win32_DeviceChangeEvent") $oReceivedEvent = $oEvents.NextEvent ConsoleWrite('The event has occured.' & @LF) Sleep(500) WEnd Nothing happens here, too. Regards, Buffo
  5. Thx for your reply Unfortunately this doesn't work... Has anyone other suggestions? Regards, Buffo
  6. Hi! I want to run a script in background that notifies a CD/DVD media replacement. How ist this to realize? If I use DriveStatus() the drive is always running on each query. Perhaps is there the possibiltiy to use WMI? I don't know I hope you can help me Thx in advance! Regards, Buffo
  7. For the examples I gave it works fine, yes But there are other possibilities given: Only a few examples which match although it shouldn't: file01.part03.rar file_test01.part02.rar file.part1.onlyfortest.part03.rar This one doesn't match although it should: filename.part001.rar My script is now a bit more complicated because I solved it with further queries: Global Const $PATH = "F:\" While 1 $var = FindFile() If $var = -1 Then Exit ... Sleep(25) WEnd Func FindFile() Local $oFileList Local $sFile, $sValue $oFileList = FileFindFirstFile($PATH & "*.*") If $oFileList = -1 Then Return -1 While 1 $sFile = FileFindNextFile($oFileList) If @error Then $sValue = -1 ExitLoop EndIf If Not StringInStr(FileGetAttrib($sFile), "D") Then If StringRegExp($sFile, "\.part0{0,3}1\.rar\z", 0) = 1 Then ... $sValue = $sFile ExitLoop Else If StringRegExp($sFile, "\.part\d{1,4}\.rar\z", 0) = 0 And StringRegExp($sFile, "\.rar\z", 0) = 1 Then ... $sValue = $sFile ExitLoop Else $sValue = -1 EndIf EndIf EndIf WEnd Return $sValue EndFunc This script exactly does what I need. I hoped it could be easier with only one regex. But now it works - that's the most important Thx all for your help Regards, Buffo
  8. Unfortenatley that won't work. I try again to explain (the second line in topic title "How to exlude?"). Imho the pattern should be something like this: (.+(\.part{0,3}1|NOT\.part\d{1,4})\.rar\z) The meaning: Match all .partxxx1 or all where .partxxxx is not contained before .rar at the end of line (where xxx can be 0 to 3 digits). How is it possible to integrate the NOT with Regex? The ^ is only for groups. I tried with (squared) brackets but it won't work Thx in advance. Regards, Buffo
  9. Many thx for your feedback But it's not so easy as I thought. I forgot that there are other possibilities that have to match. My intention is to find in a filelist all RAR-archives which are the first of a multipart archive or only single parts. Filelist: filename.can.contain.dots.part01.rar filename.can.contain.dots.part02.rar filename.can.contain.dots.part03.rar filename.can.contain.dots.part04.rar filename.can.contain.dots.part05.rar filename.can.contain.dots.part06.rar filename.can.contain.dots.part07.rar filename.can.contain.dots.part08.rar filename.can.contain.dots.part09.rar filename.can.contain.dots.part10.rar filename.can.contain.dots.part11.rar filename.can.contain.dots.part12.rar filename.with.part01.in.it.part1.rar filename.with.part01.in.it.part2.rar filename.can.contain.part.rar filename.rar The bold marked lines should match. Sorry for prompting only a example where I experimented with. But now this is the real task The complicated on this is that the strings without .part1, part01, part001 and so on should only match. Another solution out there? Regards, Buffo
  10. Hi! Today there is a problem which I cannot solve alone. The following example strings are given (a few letters, underscore, number or not, underscore and a few letters): abc_01_xyz abcd_32_xyz ab_01_wxyz def_ghi I want to match the whole line but only if it contains 01 or it does NOT contain a number. Can you help me? Thx in advance. Rgeards, Buffo
  11. Thx for your reply. But I use the old version of the dll from the start post of this thread and it works not more. Above of my last post littleclown wrote that it will work with an older version of AutoIt. Imho the problem is AutoIt. I hope that someone can release an updated version because I need it for a script Regards, Buffo
  12. For me it's not working with the newset stable 3.2.6.0, too. Will there be a new version of the UDF and/or the dll released? Thx in advance. Regards, Buffo
  13. Hello! I want to get the drive usage of computers in my local network (all drives and partitions - files and folders are not in my interest only the disk usage). Is it possible to access them (admin pass is available of course). All drives/partitions should be available without sharing. Is WMI the keyword? I don't know, perhaps anyone has ideas? Thx in advance! Regards, Buffo
  14. Fiddler will not work for me. There is a error when I want to access the router page: "Expected is CRLFCRLF returned is LFLF." Another idea?
  15. It's really a couple of months ago I asked the question and I don't need any answers any more but I want to thank you although for your help
×
×
  • Create New...