Opening PDF files from network folder with Adobe Reader DC

Nov 03
2015

In some of my software programs, I have integrated a thing like document archiving, and there customers are putting several files, mostly PDF.

Since Adobe Reader is out and installed on the machines, often PDF files that are on a shared network folder, cannot be opened anymore – Adobe Reader gives an “access denied” error.

It is the “Protected Mode” of Adobe Reader that gives this problem.

Fortunately you can disable this mode, and Adobe Reader works again as expected. Please don’t forget to enable the protected mode afterwards!

This is my VO code for this functionality:

// disable Adobe Reader protected mode
aVersions := { “11.0”, “DC” }
aReset := {}
nLen := ALen( aVersions )
for nI := 1 upto nLen
 cVersion := aVersions[nI]
 nMode := RegistryDWord( HKEY_CURRENT_USER, “Software\Adobe\Acrobat Reader\” + cVersion + “\Privileged”, “bProtectedMode” )
 if nMode == 1
  SetRegistryDWord( HKEY_CURRENT_USER, “Software\Adobe\Acrobat Reader\” + cVersion + “\Privileged”, “bProtectedMode”, 0 )
  AAdd( aReset, cVersion )
 endif
next
oProcess := SpawnProcess{ cExe, cFileName, SW_NORMAL }
for nI := 1 upto 20
 ApplicationExec( EXECWHILEEVENT )
 Sleep( 500 ) // let Acrobat reader start
next
// re-enable Adobe Reader protected mode
nLen := ALen( aReset )
for nI := 1 upto nLen
 cVersion := aReset[nI]
 nMode := RegistryDWord( HKEY_CURRENT_USER, “Software\Adobe\Acrobat Reader\” + cVersion + “\Privileged”, “bProtectedMode” )
 if nMode == 0
  SetRegistryDWord( HKEY_CURRENT_USER, “Software\Adobe\Acrobat Reader\” + cVersion + “\Privileged”, “bProtectedMode”, 1 )
  AAdd( aReset, cVersion )
 endif
next

Comments are closed.