Jump to content

Shellexecute ruins acrobat reader


Recommended Posts

hi guys,

 

when i use shellexecute in my script to open an file. it doenst start acrobat reader and not only that. it ruins acrobat and i cant start it anymore and must reinstall it. 

anyone an idea how this is possible. and question.

what can i use to open an document or file from an script that opens with defauld windows program? i used shellexecute.

Link to comment
Share on other sites

  • Moderators

@tris20 how about posting your code so we can see what you're doing, rather than having us guess?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

On 7/23/2019 at 7:04 PM, JLogan3o13 said:

@tris20 how about posting your code so we can see what you're doing, rather than having us guess?

youre totaly right. sorry.

 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=menu test.Exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#RequireAdmin
DirCreate ("c:\TEMP")
Sleep(1000)

FileInstall ("C:\Users\Retro\Documents\autoit projecten\pdf_test.pdf", "c:\TEMP\pdf_test.pdf", 1)



#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=c:\users\retro\documents\menu.kxf
Global $Menu = GUICreate("Menu", 615, 437, -1, -1)
Global $pdf = GUICtrlCreateButton("pdf", 16, 16, 75, 25)
Global $Exitbutton = GUICtrlCreateButton("Exit", 520, 400, 75, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE, $Exitbutton
            Exit
        Case $pdf
            ShellExecute("c:\TEMP\pdf_test.pdf")
    EndSwitch
WEnd

 

Link to comment
Share on other sites

What happens when you open the file from the disc by hand?

Have you tried it without the FIleInstall script? Just pure ShellExecute without any other code?

What about other PDFs?

What about other files? Have you tried ShellExecuting a random *.txt?

Have you tried the 'verb' parameter of ShellExecute?

Link to comment
Share on other sites

when i open the file from disk everything is fine. but when i opened it from the script then it doenst open. after that i even cant start acrobat reader anymore and an fresh install is needed. 

 

haven't tried any other way in the script.

 

my goal is to make an menu and from there open the pdf files or ather files. but also make it so that the files are included in the exe.

Link to comment
Share on other sites

  • 2 years later...

I'm sorry but I can't write in English, so i need to use google translator

I propose this modified 
ShellExecute("explorer.exe","c:\TEMP\pdf_test.pdf")

or remove 

#RequireAdmin

Alternatively it can be set via the following registry key:

[HKEY_CURRENT_USER\Software\Adobe\Acrobat Acrobat\DC\Privileged]

"bProtectedMode"=dword:00000000 

Edited by bdr529

To community goes all my regards and thanks

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...