Leaderboard
Popular Content
Showing content with the highest reputation on 11/13/2018 in all areas
-
About detecting changes to files?
FrancescoDiMuro and one other reacted to Somerset for a topic
Works for me! Turns around, and vanishes.2 points -
Ah.. that's a good approach to life... when confused simply ignore it and it for sure will go away.2 points
-
love to be ignored while I think the answer is in my previous post ... whatever2 points
-
Deye, To make your expression able to work with Chinese characters you need to enable Unicode mode using (*UCP) BTW the syntax of TheXman's one doesn't need it (because it doesn't use \w)2 points
-
Check the type of $kludgeVar. When it is a string then you get True. $var = "False" If $var = True Then ConsoleWrite( "**" & @CRLF) ConsoleWrite(VarGetType($var) & @CRLF) $var = False If $var = True Then ConsoleWrite( "**" & @CRLF) ConsoleWrite(VarGetType($var) & @CRLF)1 point
-
SOLVED - How do i open files from USB with Autoit?
00serk29 reacted to FrancescoDiMuro for a topic
@00serk29 Maybe you're doing a little bit of confusion... Run() is used to run an external program (.exe, .com, .bat...); ShellExecute() is used to run a program too, but to open a text file, you have to use this function. If you try to open (visually) a text file with Run(), then it won't do anything; indeed, if you use ShellExecute(), it will be opened. Try it and let us know P.S.: always post your code!1 point -
Nice, So My last edit will also work on this string reversed .. $str = "[2018.11.13-04:07:54]:新的输出:A1 B2 C3 D4 E5 " $patt = '(*UCP)(?:\w.?\s)+[\w\d].' MsgBox(0, '', '"' & StringRegExp($str, $patt, 3)[0] & '"') $str = StringReverse($str) MsgBox(0, '', '"' & StringRegExp($str, $patt, 3)[0] & '"') Deye1 point
-
Switch $selectedflag[$charcnt] case 11, 12, 15, 17, 19, 20, 21, 24 MsgBox (0,"ok", "hit") EndSwitch1 point
-
if statement help
yasha reacted to FrancescoDiMuro for a topic
@yasha Look at Switch statement in the Help file Switch $selectedflag[$charcnt] Case 11, 12, 15, 17, 19, 21, 21, 24 ; Do something Case Else ; ... EndSwitch1 point -
@Thy Search patterns in AutoIt are not surrounded by "/". #include <Constants.au3> $string = "[2018.11.13-04:07:54]:新的输出:A1 B2 C3 D4 E5 "; MsgBox (0,'',$string) $result = StringRegExp($string, '(?<=新的输出:).*$', $STR_REGEXPARRAYFULLMATCH) MsgBox (0,'',$result[0])1 point
-
show us in what case will it fail ,also try the edited above Deye1 point
-
How to use WinIO to access memory
francischi reacted to Nine for a topic
Here the code I used and it is working... #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Local $hDLL1 = DllOpen("WinIo64.dll") Sleep (200) ConsoleWrite ("hdll = " & $hDLL1 & @CRLF) $result = DllCall($hDLL1, "bool", "InitializeWinIo") Sleep (1000) ConsoleWrite ("Init " & $result[0] & @CRLF) Local $b = "0xD6F7" For $i = 1 to 20 $result = DllCall($hDLL1, "bool", "GetPhysLong", "int_ptr", $b, "dword*", 0) $b += 1 Sleep (1000) ConsoleWrite ("Get " & $result[0] &"/" & $result[1] &"/" & $result[2] & "/" & @CRLF) Next DllCall($hDLL1, "none", "ShutdownWinIo") DllClose($hDLL1) Results : hdll = 1 Init 1 Get 1/55031/3389158144/ Get 1/55032/3402236531/ Get 1/55033/13289986/ Get 1/55034/51914/ Get 1/55035/202/ Get 1/55036/0/ Get 1/55037/0/ Get 1/55038/0/ Get 1/55039/0/ Get 1/55040/0/ Get 1/55041/0/ Get 1/55042/0/ Get 1/55043/0/ Get 1/55044/0/ Get 1/55045/1442840576/ Get 1/55046/1498808320/ Get 1/55047/1247368704/ Get 1/55048/4872534/ Get 1/55049/19033/ Get 1/55050/74/1 point -
Regex... Repeating Block of Regex
gruntydatsun reacted to mikell for a topic
... and there is nothing more to do but add the \K ("keep out") verb $sAfter = StringRegExpReplace($sBefore, "(?m)(^\s{3}<null/>\s\r\n){3}\K", "$1") Edit Please note that as \K is used here as a lookbehind alternative, obviously this works too $sAfter = StringRegExpReplace($sBefore, "(?m)(?<=(^\s{3}<null/>\s\r\n){3})", "$1")1 point -
Regex... Repeating Block of Regex
gruntydatsun reacted to TheXman for a topic
@gruntydatsun Here's one of several ways you could do it. example() Func example() Local $sBefore = _ '<row name="subTotal" mergeCellEnd="7" mergeCellStart="1"> ' & @CRLF & _ ' <cell type="text" name="subTotal">Subtotal: Hotpants Sales To Senior Execs</cell> ' & @CRLF & _ ' <null/> ' & @CRLF & _ ' <null/> ' & @CRLF & _ ' <null/> ' & @CRLF & _ ' <cell type="number" name="Year 1">0</cell> ' & @CRLF & _ ' <cell type="number" name="Year 2">0</cell> ' & @CRLF & _ ' <cell type="number" name="Year 3 and 4">1,000</cell> ' & @CRLF & _ ' <null/> ' & @CRLF & _ ' <null/> ' & @CRLF & _ '</row> ' & @CRLF Local $sAfter = StringRegExpReplace($sBefore, "(?sm)((?:^\s{3}<null/>\s\r\n){3})", "\1 <null/> " & @CRLF) ConsoleWrite("Before:" & @CRLF) ConsoleWrite($sBefore & @CRLF) ConsoleWrite("After:" & @CRLF) ConsoleWrite($sAfter & @CRLF) EndFunc1 point -
Great job jdelaney ! I made a similar script (without any filter), posted in the french forum : http://www.autoitscript.fr/forum/viewtopic.php?p=74100#p74100 Have a look to it : I used the RegExp method to avoid the use of Array.au31 point
-
good call on that one! I edited it a little bit and wrote to the console instead of msgbox for my personal purposes ...but this is what I got #RequireAdmin ;================================================================================== ; function is used to determine if there are any issues in the device manager ;================================================================================== Dim $bProblemsExist, $bDisabledExist, $Code = "", $codemsg = "" $bProblemsExist = false $bDisabledExist = false $strComputer = "." DeviceProblems() Func DeviceProblems() $DEVobjWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2") $DEVcolItems = $DEVobjWMIService.ExecQuery("Select * from Win32_PnPEntity " & "WHERE ConfigManagerErrorCode <> 0") For $DEVobjItem in $DEVcolItems $Code = $DEVobjItem.name & ": " if $DEVobjItem.ConfigManagerErrorcode = 1 Then $bProblemsExist = True $Code &= "System Failure - No Config" $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel" Elseif $DEVobjItem.ConfigManagerErrorcode = 2 Then $bProblemsExist = True $Code &= "Device could not load driver" $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel." Elseif $DEVobjItem.ConfigManagerErrorcode = 3 Then $bProblemsExist = True $Code &= "System Failure - Run Out of Memory" $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel." Elseif $DEVobjItem.ConfigManagerErrorcode = 4 Then $bProblemsExist = True $Code &= "Device Failure - Devloader/Static VxD/Configured is of Wrong Type." $codemsg = "This code indicates that the .inf file for this device may be incorrect or the registry may be damaged. This error code is displayed if the .inf file specifies a field that should be text, but is binary instead. In addition to following the recommended suggestions, use Device Manager to remove the device, then run the Add New Hardware tool in Control Panel. If you continue to receive this error code, please contact the hardware's manufacturer for an updated .inf file. " Elseif $DEVobjItem.ConfigManagerErrorcode = 5 Then $bProblemsExist = True $Code &= "Device Failure - Lacked an Arbitrator." $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel. " Elseif $DEVobjItem.ConfigManagerErrorcode = 6 Then $bProblemsExist = True $Code &= "Boot config Conflicted." $codemsg = "One or more of your devices within your computer are conflicting, such as an IRQ conflict. Ensure that the IRQs DMA, and I/O addresses are all correct." Elseif $DEVobjItem.ConfigManagerErrorcode = 7 Then $bProblemsExist = True $Code &= "Filtering Failed - Possible problem in Device Driver Code." $codemsg = "If the device works correctly, you do need not to perform any steps to correct the code. If the device does not work correctly, use Device Manager to remove the device and then run the Add New Hardware tool in Control Panel. If you continue to receive this error code and the device does not function properly, check with the hardware manufacturer for an updated driver. " Elseif $DEVobjItem.ConfigManagerErrorcode = 8 Then $bProblemsExist = True $Code &= "System failure - Devloader Not Found" $codemsg = "If you are receiving an error about Devloader, there is no known resolution. If you are receiving any other error, reinstall the driver or update the driver. If you are getting an error with a System Devloader, Windows should be reinstalled because the Devloader is built into the Vmm32.vxd." Elseif $DEVobjItem.ConfigManagerErrorcode = 9 Then $bProblemsExist = True $Code &= "Invalid Data in Registry." $codemsg = "This code means that the information in the registry for this device is invalid. It may be possible to resolve this error by using Device Manager to remove the device, then run the Add New Hardware tool in Control Panel. If you continue to receive this error code, contact the hardware's manufacturer for the proper registry settings or updated drivers. " Elseif $DEVobjItem.ConfigManagerErrorcode = 10 Then $bProblemsExist = True $Code &= "Device Failed to start." $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel." Elseif $DEVobjItem.ConfigManagerErrorcode = 11 Then $bProblemsExist = True $Code &= "Device Failure." $codemsg = "To resolve this error, run the Automatic Skip Driver utility from the System Information tool. If the problem persists, contact the hardware manufacturer for updated drivers. " Elseif $DEVobjItem.ConfigManagerErrorcode = 12 Then $bProblemsExist = True $Code &= "Was normal conflicting - One of the resource arbitrators returned a failure. " $codemsg = "One or more of your devices within your computer are conflicting, such as an IRQ conflict. Ensure that the IRQs DMA, and I/O addresses are all correct." Elseif $DEVobjItem.ConfigManagerErrorcode = 13 Then $bProblemsExist = True $Code &= "System Failure - Possible problem in Device Driver or Windows 95 Code. " $codemsg = "This code indicates that the device driver did not find the hardware. To resolve this error code, first ensure the device is properly installed. As an alternative, use Device Manager to remove the device and then run the Add New Hardware tool in Control Panel. " Elseif $DEVobjItem.ConfigManagerErrorcode = 14 Then $bProblemsExist = True $Code &= "Need to restart your computer for this device to be re setup or to be finished installed." $codemsg = "Restart the computer" Elseif $DEVobjItem.ConfigManagerErrorcode = 15 Then $bProblemsExist = True $Code &= "This device is causing a resource conflict." $codemsg = "One or more of your devices within your computer are conflicting, such as an IRQ conflict. Ensure that the IRQs DMA, and I/O addresses are all correct." Elseif $DEVobjItem.ConfigManagerErrorcode = 16 Then $bProblemsExist = True $Code &= "Was not fully detected, not all detected." $codemsg = "Double-click on the device, click the Resources tab and manually enter the settings. " Elseif $DEVobjItem.ConfigManagerErrorcode = 17 Then $bProblemsExist = True $Code &= "Device failure - Resource number was not found." $codemsg = "This code means that the hardware is a multiple-function device and the .inf file for the device is providing invalid information on how to split the device's resources to the child devices. To resolve this error code, use Device Manager to remove the device, then run the Add New Hardware tool in Control Panel. If you continue to receive this error code, contact the hardware's manufacturer about an updated .inf file. " Elseif $DEVobjItem.ConfigManagerErrorcode = 18 Then $bProblemsExist = True $Code &= "Reinstall." $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel." Elseif $DEVobjItem.ConfigManagerErrorcode = 19 Then $bProblemsExist = True $Code &= "System Failure - Registry returned unknown result" $codemsg = "Problem in the registry. If you have Windows 95 and you have not made a backup of the registry you will need to reinstall Windows.If you have Windows 98: To resolve this issue, follow the recommended solution, which will run Scanreg.exe. If this does not resolve the issue, type scanreg /restore from C:\Windows\COMMAND. " Elseif $DEVobjItem.ConfigManagerErrorcode = 20 Then $bProblemsExist = True $Code &= "System Failure - VxDLdr Returned Unknown Result." $codemsg = "This code means VxD Loader (Vxdldr) returned an unknown result. For example, there could a version mismatch between the device driver and the operating system driver. Update the driver. If that does not work, try removing the device from Device Manager and then running the Add New Hardware Wizard in Control Panel. " Elseif $DEVobjItem.ConfigManagerErrorcode = 21 Then $bProblemsExist = True $Code &= "Will Be Removed." $codemsg = "Restart the computer." Elseif $DEVobjItem.ConfigManagerErrorcode = 22 Then $bDisabledExist = True $Code &= "This device is disabled." $codemsg = "Double-click on the device and Enable. If this does not work, update the driver. If this also does not work, remove the device and reinstall through Add New Hardware Wizard in Control Panel." Elseif $DEVobjItem.ConfigManagerErrorcode = 23 Then $bProblemsExist = True $Code &= "Device Failure - Devloader was not ready." $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel." Elseif $DEVobjItem.ConfigManagerErrorcode = 24 Then $bProblemsExist = True $Code &= "Device not Found, This device is either missing or not working properly." $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel." Elseif $DEVobjItem.ConfigManagerErrorcode = 25 Then $bProblemsExist = True $Code &= "Was Moved - Possible problem in device driver code." $codemsg = "Attempt first to restart the computer at least two times, if you continue to get this error, Reinstall Windows." Elseif $DEVobjItem.ConfigManagerErrorcode = 26 Then $bProblemsExist = True $Code &= "Device Failure." $codemsg = "First restart the computer. If this does not resolve the issue, check for updated drivers. In some cases, this issue may also be resolved by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel." Elseif $DEVobjItem.ConfigManagerErrorcode = 27 Then $bProblemsExist = True $Code &= "Device failure - No Valid Log configuration" $codemsg = "This code means that the portion of the registry describing possible resources for a device does not contain valid entries. For example, the device is marked as configurable, but the configuration information in the .inf file is set to hardwired. To resolve this error code, use Device Manager to remove the device and then run the Add New Hardware tool in Control Panel. If the device still does not work, consult the hardware manufacturer for updated drivers or further assistance. " Elseif $DEVobjItem.ConfigManagerErrorcode = 28 Then $bProblemsExist = True $Code &= "Failed Installation - This device was not installed completely." $codemsg = "Verify you have the latest driver installed for your device. You may also be able to resolve this issue by removing the device in Device Manager and going through the Add New Hardware Wizard in Control Panel." Elseif $DEVobjItem.ConfigManagerErrorcode = 29 Then $bProblemsExist = True $Code &= "Hardware Disabled - This device does not work and cannot be made to work." $codemsg = "Ensure that the device is not disabled through BIOS. Many times Windows cannot override settings in the BIOS. If the device is enabled there is no other known resolution." Elseif $DEVobjItem.ConfigManagerErrorcode = 30 Then $bProblemsExist = True $Code &= "Cant Share IRQ." $codemsg = "A PCI/EISA SCSI controller is sharing an IRQ that is also in use by a real-mode device driver set not to be overwritten. Remove the real mode driver that is using the same IRQ as the device from the config.sys or autoexec.bat." Elseif $DEVobjItem.ConfigManagerErrorcode = 31 Then $bProblemsExist = True $Code &= "<device> is not working properly." $codemsg = "The properties button displays the properties for the other device. More than likely the other device will also have one of these Device Manager error codes. Follow all the recommended solutions. If the devices still do not work remove the devices from Device Manager and use the Add New Hardware wizard in Control Panel to redetect them. Finally, verify that your devices have the latest drivers. " Elseif $DEVobjItem.ConfigManagerErrorcode = 32 Then $bProblemsExist = True $Code &= "Cannot install the device because cannot access the Networked drive." $codemsg = "First, restart the computer. If this does not resolve your issue, verify that the device you are attempting to copy from is properly working. If the device is working, verify you have the latest drivers from the manufacturer." Elseif $DEVobjItem.ConfigManagerErrorcode = 33 Then $bProblemsExist = True $Code &= "Device is not responding." $codemsg = "This error is usually only shown when hardware device has failed. Suggest replacing the hardware device." Elseif $DEVobjItem.ConfigManagerErrorcode = 34 Then $bProblemsExist = True $Code &= "The device requires manual configuration." $codemsg = "Set the jumpers for the device and configure the device manually through Device Manager. If this device has worked in the past and has stopped working uninstall any recently installed programs." Elseif $DEVobjItem.ConfigManagerErrorcode = 35 Then $bProblemsExist = True $Code &= "BIOS does not contain necessary resource assignments." $codemsg = "Obtain the latest BIOS update." Elseif $DEVobjItem.ConfigManagerErrorcode = 36 Then $bProblemsExist = True $Code &= "IRQ translation failed." $codemsg = "Adjust the IRQ reservation settings in CMOS (BIOS) setup." Elseif $DEVobjItem.ConfigManagerErrorcode = 37 Then $bProblemsExist = True $Code &= "The DriverEntry routine failed when attempted by this driver." $codemsg = "Download and install the latest driver for the device with the error. If you're running the 64-bit version of Windows, make sure you're installing a 64-bit driver and not a 32-bit driver." Elseif $DEVobjItem.ConfigManagerErrorcode = 38 Then $bProblemsExist = True $Code &= "The driver cannot load because a previous instance is still loaded." $codemsg = "Restart the computer. If after restarting the computer the issue persists, download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers." Elseif $DEVobjItem.ConfigManagerErrorcode = 40 Then $bProblemsExist = True $Code &= "Information in the registry entry for this driver is invalid." $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers." Elseif $DEVobjItem.ConfigManagerErrorcode = 41 Then $bProblemsExist = True $Code &= "A driver was loaded but Windows cannot find the device. " $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers." Elseif $DEVobjItem.ConfigManagerErrorcode = 42 Then $bProblemsExist = True $Code &= "Bus driver has created two devices with the same names." $codemsg = "Restart the computer." Elseif $DEVobjItem.ConfigManagerErrorcode = 43 Then $bProblemsExist = True $Code &= "A device driver notified the operating system that the device failed." $codemsg = "This error is usually only shown when hardware device has failed. Suggest replacing the hardware device." Elseif $DEVobjItem.ConfigManagerErrorcode = 44 Then $bProblemsExist = True $Code &= "The device driver was stopped by other software on the computer." $codemsg = "Restart the computer." Elseif $DEVobjItem.ConfigManagerErrorcode = 45 Then $bProblemsExist = True $Code &= "The device is not present or was previously attached to the computer." $codemsg = "Re-attach the disconnected device." Elseif $DEVobjItem.ConfigManagerErrorcode = 46 Then $bProblemsExist = True $Code &= "The device is not available because the computer is shutting down." $codemsg = "The computer is in the process of shutting down. When computer restarts the device should function as normal." Elseif $DEVobjItem.ConfigManagerErrorcode = 47 Then $bProblemsExist = True $Code &= "The device is ready for removal." $codemsg = "Unplug the hardware device and plug it back in or restart the computer." Elseif $DEVobjItem.ConfigManagerErrorcode = 48 Then $bProblemsExist = True $Code &= "Driver incompatibility." $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers." Elseif $DEVobjItem.ConfigManagerErrorcode = 49 Then $bProblemsExist = True $Code &= "The system hive has exceeded its maximum size and new devices cannot work until the size is reduced. " $codemsg = "Uninstall any un-used hardware devices." Elseif $DEVobjItem.ConfigManagerErrorcode = 52 Then $bProblemsExist = True $Code &= "The driver may be unsigned or corrupted. " $codemsg = "Download the latest drivers from the manufacturer, uninstall the current driver, and then install the latest drivers." Else $codemsg = "Device Manager is Clean" EndIf ConsoleWrite("Device Manager Error Found!! " & @CRLF & $Code & " " & $codemsg & @CRLF & @CRLF) ;msgbox(4096,$Code,$codemsg) Next If $bDisabledExist = False And $bProblemsExist = False Then $Code = "No Problems Found!!" $codemsg = "Device Manager is Clean." ConsoleWrite($Code & " " & $codemsg & @CRLF) EndIf EndFunc1 point
-
re-read the help on the date control #include <GUIConstants.au3> GUICreate("My GUI", 1016, 687, 2, 11) ; will create a dialog box that when displayed is centered $Date = GUICtrlCreateDate("2006/01/01", 32, 138, 177, 25,$DTS_SHORTDATEFORMAT) GUISetState() GUICtrlSetData($Date,"2006/01/24") While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend1 point