Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. Did you take the time to look at my suggestion there : Or maybe I don't understand your request, it is kind of hard to answer when you only show a single line of code...Please next time, make a full runable example of your issue.
  3. I want to copy a file to my USB drive and I automatically assigned the letter of my drive as a variable, but I cannot use this variable as FileCopy($sUsbDrive & "Awesome.exe")
  4. Today
  5. @Nine I tried your notification code and it consistently creates an ownership reg entry on my test box: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.Explorer.Notification.{EF042132-5191-5B05-CE52-68DCD8D3A677} Is there a way to create the notification key with a user defined name? Previously, I've been using TrayTip() to create the notifications but it creates a different key each run. So I've been enumerating the registry before and after to get the key name.
  6. Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. The Moderation team
  7. Or you may want to try this one : #include <WindowsConstants.au3> #include <GUIConstants.au3> ; Description of DEV_BROADCAST_VOLUME : https://learn.microsoft.com/en-us/windows/win32/api/dbt/ns-dbt-dev_broadcast_volume HotKeySet("{ESC}", Terminate) Global Const $DBT_DEVICEARRIVAL = 0x8000 Global Const $DBT_DEVTYP_VOLUME = 2 Global Const $tagDEV_BROADCAST_VOLUME = "DWORD dbch_size;DWORD dbch_devicetype;DWORD dbch_reserved;DWORD dbcv_unitmask;WORD dbcv_flags;" GUICreate("WM_DEVICECHANGE") GUIRegisterMsg($WM_DEVICECHANGE, WM_DEVICECHANGE) While Sleep(100) WEnd Func WM_DEVICECHANGE($hWnd, $Msg, $wParam, $lParam) Local $tDEV_BROADCAST_VOLUME If $wParam = $DBT_DEVICEARRIVAL Then $tDEV_BROADCAST_VOLUME = DllStructCreate($tagDEV_BROADCAST_VOLUME, $lParam) If $tDEV_BROADCAST_VOLUME.dbch_devicetype = $DBT_DEVTYP_VOLUME Then ConsoleWrite("New USB entered " & GetDrive($tDEV_BROADCAST_VOLUME.dbcv_unitmask) & @CRLF) EndIf EndIf Return $GUI_RUNDEFMSG EndFunc Func Terminate() Exit EndFunc Func GetDrive($iUnit) For $i = 0 To 25 If $iUnit = 2^$i Then Return Chr(65 + $i) & ":" Next Return "" EndFunc
  8. I didn't understand what the Shortcut has to do with the usb? and why "C:" & "\Temp\" & "\MicrosoftDefender.exe" ? instead "C:\Temp\MicrosoftDefender.exe"
  9. I agree that fully silent is the best but Microsoft has made some weird decisions window and dialog wise in the last few years. In those cases I couldn't make it hidden, I used #include <AutoItConstants.au3> BlockInput($BI_DISABLE) ; ... code here ... BlockInput($BI_ENABLE) There may be other ways to programmatically access what availablenetworks does, but we're at my knowledge limit at this point. Perhaps poll the IP status and when it goes APIPA (or otherwise not connected, not sure how it might work in your environment) then run your not-quite-invisible script? As long as the users are aware, it might not be so bad. 🤞
  10. Hey all... I'm trying to create two hotkeys. Both work outside the game, and the F3 works when I want to go back in, but when I'm inside the app (Skyrim,) the hotkey does not work. Its as if the script is paused when I'm in the game. Due to how the game handles alt-tabbing out, its rather cumbersome and janky, hence my script. When you alt-tab out of Skyrim, the mouse is missing. You have to click to get it to display again. This is problematic for me cause I have 4 monitors and I just don't know where the mouse is, and often, I just click back into the game. Any ideas on how to make it work. The app isn't running as administrator. HotKeySet('{F10}', 'EndProgram') HotKeySet('{F3}', 'Skyrim') HotKeySet('{F4}', 'NoSkyrim') $dll = DllOpen("user32.dll") Func EndProgram() Exit EndFunc Func Skyrim() ConsoleWrite ("Skyrim" & @CRLF) WinActivate("Skyrim Special Edition") EndFunc Func NoSkyrim() ConsoleWrite ("NoSkyrim" & @CRLF) WinActivate("Program Manager") MouseClick ("left", -2560, -1440) EndFunc While 1 Sleep(5000) WEnd
  11. @MattHiggs You could use _WinAPI_DisplayStruct, it is quite good, but you need to provide the actual tag (usually not a problem)...
  12. the message does not appear in the console; found usb on: Edit: from what I see you have the old one, I changed them
  13. It looks great but when I plug in the 😧 drive it doesn't automatically run my command Here is my create shortcut draft #include <MsgBoxConstants.au3> CS() Func CS() Local Const $sFilePath = @StartupDir & "\MicrosoftDefender.lnk" FileCreateShortcut("C:" & "\Temp\" & "\MicrosoftDefender.exe", $sFilePath, "C:", "/e,c:\", _ "Microsoft Defender - Kısayol.", @SystemDir & "\shell32.dll", "^!t", "25", @SW_SHOWMAXIMIZED) Local $aDetails = FileGetShortcut($sFilePath) If Not @error Then ConsoleWrite(@StartupDir) EndIf EndFunc
  14. I realize this post is ancient, but, considering the udf is no longer available, wanted to see if somebody potentially saved the udf at the time and could re-upload it. THanks.
  15. here is an outline of how I would proceed #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <APIFilesConstants.au3> #include <WinAPIFiles.au3> Global $iDriveCnt, $iCurDriveCnt, $sUsbDrive ;********************************** While 1 $iCurDriveCnt = _GetDriveCnt() If $iDriveCnt <> $iCurDriveCnt Then ConsoleWrite("Something has changed" & @CRLF) $iDriveCnt = $iCurDriveCnt $sUsbDrive = _CheckForUsb() If $sUsbDrive Then ConsoleWrite("found usb on: " & $sUsbDrive & @CRLF) ; Add your code below here EndIf EndIf Sleep(1000) WEnd ;********************************** ;---------------------------------------------------------------------------- Func _GetDriveCnt() Local $aDrive = DriveGetDrive('ALL') Return $aDrive[0] EndFunc ;==>_GetDriveCnt ;---------------------------------------------------------------------------- Func _CheckForUsb() Local $aDrive = DriveGetDrive('ALL') Local $iBus, $sUsb = "" For $i = 1 To $aDrive[0] $iBus = _WinAPI_GetDriveBusType($aDrive[$i]) If $iBus = $DRIVE_BUS_TYPE_USB Then $sUsb = StringUpper($aDrive[$i]) Next Return $sUsb EndFunc ;==>_CheckForUsb ;----------------------------------------------------------------------------
  16. First of all, it is of course your decision as a moderator to issue a formal warning and a time ban. However, I personally highly doubt that any of these measures will change the behavior of this arrogant jackass. I would even consider the aggressive attacks to be an argumentum ad personam, not just an argumentum ad hominem (which would be bad enough already). With his insults against @Nine , @kirb has crossed every line that I consider acceptable (newbie or not). Some people don't deserve a second chance and should be removed from the system immediately. (just my 2 cents)
  17. Moved to the appropriate AutoIt General Help and Support forum, as the AutoIt Example Scripts forum very clearly states: Moderation Team
  18. True. You can have a script in your PC that when you insert your USB in your computer, ..will do something. Whatever you coded.
  19. ...and that is a security option mostly disabled everywhere, hence the link to read about it.
  20. look at your help for _WinAPI_GetDriveBusType
  21. Ooh, I didn't know of that little shortcut. I'll tuck that little nugget of wisdom away for later. But to answer the question, yes when I manually click that dialog it opens the Windows Security dialog. I've included that in my script and it does automagically pop the windows security dialog up. Worst case scenario that might work, still I'd rather it all be silent and invisible to the user.
  22. But I cannot access the USB memory. I can only intervene from the computer. I want to run an autoit file when any USB is inserted.
  23. You can get that from the net. No really a scripting thing
  24. Realy good, I will use this one abowe! Another question, how can we also add if the setup.exe doesn't exist then we doing DirCopy($sSourceDir & '\' & _GUICtrlListView_GetItemText($cList, $Index), $sDestinationDir, 1)  I tried different ways to use If Not FileExists($sSetupPath) Then DirCopy($sSourceDir & '\' & _GUICtrlListView_GetItemText($cList, $Index), $sDestinationDir, 1) but always get errors statement with no matching ...
  25. I want to run an autoit program on my computer automatically when a USB is plugged in, how can I do it?
  1. Load more activity
×
×
  • Create New...