JonF Posted May 9, 2022 Share Posted May 9, 2022 (edited) I am sick and freakin' tired of Edge grabbing the PDF association. I located a little program on the Web and wrote an AutoIT wrapper. Using FileInstall to include the program that actually does it. Then Task Manager runs it every half hour. It's in C:\Program FIles (x86)\GetPDF\ Almost every time it runs Windows can't find the attached file. ? #cs ---------------------------------------------------------------------------- Set Adobe Acrobat or Adobe Acrobat Reader as default for PDF in Windows 10 or 11 #ce ---------------------------------------------------------------------------- #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #include <Array.au3> If $Cmdline[0] = 0 Then MsgBox($MB_OK,"Error",'Specify "Acrobat" or "Reader" as an argument to choose the defalt PDF handler') ElseIf StringLower($Cmdline[1]) <> "acrobat" And StringLower($Cmdline[1]) <> "reader" Then MsgBox($MB_OK,"Error",'The command line argument "' & $Cmdline[1] & '" is not "Acrobat" or "Reader"') Else If StringLower($Cmdline[1]) == "acrobat" Then $AdobeHandler = "Acrobat.Document.DC" ; Adobe Acrobat Else $AdobeHandler = "AcroExch.Document.DCC" ; Adobe Acrobat Reader EndIf ; Get the current PDF handler $PDFHandler = RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice","ProgId") ; SetUserFTA from http://kolbi.cz/blog/2017/10/25/setuserfta-userchoice-hash-defeated-set-file-type-associations-per-user/ ; or http://web.archive.org/web/20220412005411/https://kolbi.cz/blog/2017/10/25/setuserfta-userchoice-hash-defeated-set-file-type-associations-per-user/ ; If Adobe isnt the PDF handler... If $AdobeHandler <> $PDFHandler Then $Result = ShellExecuteWait(@ScriptDir & "\SetUserFTA.exe",".pdf " & $AdobeHandler,"",$SHEX_OPEN,@SW_HIDE) ; MsgBox(0,"Result",$Result) EndIf EndIf Edited May 9, 2022 by JonF Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 10, 2022 Moderators Share Posted May 10, 2022 Moved to the appropriate forum. Moderation Team Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jerem488 Posted May 10, 2022 Share Posted May 10, 2022 Hello, You must use fileinstall() function Best regards Qui ose gagneWho Dares Win[left]CyberExploit[/left] Link to comment Share on other sites More sharing options...
JonF Posted May 10, 2022 Author Share Posted May 10, 2022 Um, as I said, I used FileInstall. It doesn't work. Link to comment Share on other sites More sharing options...
Developers Jos Posted May 10, 2022 Developers Share Posted May 10, 2022 1 hour ago, JonF said: Um, as I said, I used FileInstall. It doesn't work. Um... but it isn't in the posted code.... so are we missing a part of the script? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Skysnake Posted May 12, 2022 Share Posted May 12, 2022 I'm getting a lot of this Windows 11 reports Windows 10 Error 0x800700E1: Defender detects unwanted software/virus It seems MS made the malware detection a lot sticter Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
Confuzzled Posted June 7, 2022 Share Posted June 7, 2022 (edited) Is your exe signed and registered in the Microsoft Store? Nope? Then it probably will throw an exception and need a manual override to be saved. FileInstall was a good idea and I have used it for many things, but it wont be very useful for exe droppers much more, as AutoIT compiled exe files are recognised (misclassified but that is irrelevant for most users that are running your wrapper code) as badware. The skript kiddies with their silly malware have spoiled it for everybody. Edited June 7, 2022 by Confuzzled 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