Jump to content

FilleInstall - "Windows cannot find file..." - (Moved)


Recommended Posts

Posted (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 by JonF
Link to post
Share on other sites
  • Moderators

Moved to the appropriate forum.

Moderation Team

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
  • Developers
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 post
Share on other sites

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 post
Share on other sites
  • 4 weeks later...
Posted (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 by Confuzzled
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...