# folderitem.launch does not launch PDF

**URL:** <https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159>\
**Category:** General\
**Created:** [February 16, 2017, 10:07pm UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159 "2017-02-16T22:07:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Gardner](https://forum.xojo.com/user_avatar/forum.xojo.com/matthew_gardner/32/470_2.png) [@Matthew\_Gardner](https://forum.xojo.com/u/Matthew_Gardner)\
**Post date:** [February 16, 2017, 10:07pm UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/1 "2017-02-16T22:07:46Z")

</div>

Hi all - I have a Windows client evaluating our payroll software, and we supply various PDF documents in a man subfolder, and generate a number of PDF output files (tax certificates etc)…but at this particular site it seems that f.launch (f being the PDF) doesn’t do anything - no error, just nothing.

This is the only site I’ve ever seen that doesn’t open a PDF in whatever viewer they use.

If I open the man folder and double-click the PDF document it opens fine in Adobe Reader (so it seems the default file association is set up correctly).

Perhaps this could be a profile security issue? Anyone encountered such weirdness (and hopefully a solution)?

Many thanks.

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [February 16, 2017, 10:17pm UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/2 "2017-02-16T22:17:35Z")

</div>

Silly question… but are you sure the path information in “F” is 100% correct?  
put a break at the Launch and examine it… it needs to be the FULL path to the document

---

<div class="post-metadata">

**Author:** ![Matthew\_Gardner](https://forum.xojo.com/user_avatar/forum.xojo.com/matthew_gardner/32/470_2.png) [@Matthew\_Gardner](https://forum.xojo.com/u/Matthew_Gardner)\
**Post date:** [February 16, 2017, 10:31pm UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/3 "2017-02-16T22:31:25Z")

</div>

Works in _almost_ 100% of cases - this is the only time I’ve ever seen or heard of it not working (out of 1000’s of sites).

[code]Function HelpThepayprocess() As Boolean  
dim f as FolderItem

if Develop() then  
f=GetFolderItem(“man”).Child(“PDF”).Child(“Pay Process.pdf”)  
else  
f=GetFolderItem(“man”).Child(“Pay Process.pdf”)  
end

if f.Exists then  
f.Launch  
else  
MsgBox(“File not found”+EndOfLine+EndOfLine+“Sorry, the file Pay Process.pdf isn’t where it should be”+EndOfLine+EndOfLine+“Please visit the website for the latest documentation (Help…Website)”)  
end

Return True

End Function[/code]

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [February 16, 2017, 10:36pm UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/4 "2017-02-16T22:36:32Z")

</div>

and if you do a break point at LAUNCH it does in fact stop there? but then “nothing happens”  
what is f.lasterrorcode?

---

<div class="post-metadata">

**Author:** ![Jared\_Feder](https://forum.xojo.com/user_avatar/forum.xojo.com/jared_feder/32/3036_2.png) [@Jared\_Feder](https://forum.xojo.com/u/Jared_Feder)\
**Post date:** [February 16, 2017, 10:37pm UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/5 "2017-02-16T22:37:19Z")

</div>

Is it possible that they do not have a PDF viewer installed, or don’t have a default application selected for PDF files?

---

<div class="post-metadata">

**Author:** ![Matthew\_Gardner](https://forum.xojo.com/user_avatar/forum.xojo.com/matthew_gardner/32/470_2.png) [@Matthew\_Gardner](https://forum.xojo.com/u/Matthew_Gardner)\
**Post date:** [February 16, 2017, 10:44pm UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/6 "2017-02-16T22:44:18Z")

</div>

Thanks Dave

No idea - the site is in the Cook Islands, I’m in New Zealand. The price we sell a product for doesn’t permit writing a custom build and deploying it for a problem that exists on one machine and works flawlessly everywhere but there…I could log it in the next build but I’m pretty suspicious of the machine itself or a security or profile setting somewhere…so, it’ll take some time to get any in-depth info about f.lasterrorcode (good idea, I’ll log it)

[quote]If I open the man folder and double-click the PDF document it opens fine in Adobe Reader (so it seems the default file association is set up correctly).  
[/quote]

I’m going to suggest they try it on a different machine - if the same thing happens then I’ll be sure that their security profile (or whatever) is affecting the app’s ability to launch a PDF (they’re on Windows 7 Service Pack 1 (Build 7601)) - and if that’s the case then I still don’t have a solution - maybe move them to our cloud edition (love XojoWE)

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [February 16, 2017, 10:49pm UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/7 "2017-02-16T22:49:22Z")

</div>

I would instruct them how to install PDF Reader. It’s probably the problem. Windows 7 has nothing in the default system to read PDF.

---

<div class="post-metadata">

**Author:** ![LangueR](https://forum.xojo.com/letter_avatar_proxy/v4/letter/l/9d8465/32.png) [@LangueR](https://forum.xojo.com/u/LangueR)\
**Post date:** [February 16, 2017, 11:09pm UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/8 "2017-02-16T23:09:19Z")

</div>

Have they run (or you remotely) the application as ADMIN? Maybe their security (as you say) prevents your app from launching the application from within. You could also try to shell to it, but you said creating a custom build is not an option.

---

<div class="post-metadata">

**Author:** ![Matthew\_Gardner](https://forum.xojo.com/user_avatar/forum.xojo.com/matthew_gardner/32/470_2.png) [@Matthew\_Gardner](https://forum.xojo.com/u/Matthew_Gardner)\
**Post date:** [February 16, 2017, 11:53pm UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/9 "2017-02-16T23:53:34Z")

</div>

Thanks Michel and Langue - the user is able to install the software, but we could try running it explicitly as Admin and see what happens. They’re installing a trial on a different machine to assess if it’s global at their site (then it’s security - it is a gov site…), otherwise just the original PC - and maybe reinstalling the reader will correct the problem (though as I’ve said already the association appears to work correctly - double-clicking the pdf itself opens OK in Adobe Reader - man I hate windows.

---

<div class="post-metadata">

**Author:** ![Matthew\_Gardner](https://forum.xojo.com/user_avatar/forum.xojo.com/matthew_gardner/32/470_2.png) [@Matthew\_Gardner](https://forum.xojo.com/u/Matthew_Gardner)\
**Post date:** [February 16, 2017, 11:58pm UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/10 "2017-02-16T23:58:12Z")

</div>

Ok - Ive added this to the code and it’ll log any errors (and display it). Weird.

```auto
    if f.LastErrorCode <> 0 then
      WriteError("Cannot open "+f.ShellPath+": error code "+str(f.LastErrorCode))
    end
```

Thanks - I’ll report back if I find out anything useful 🙂

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [February 17, 2017, 1:36am UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/11 "2017-02-17T01:36:42Z")

</div>

bit nit-picky, but I’d change that to NATIVEPATH instead of SHELLPATH… but thats just me 🙂

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [February 17, 2017, 9:03am UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/12 "2017-02-17T09:03:40Z")

</div>

> [@316292:@Dave S](#):
>
> bit nit-picky, but I’d change that to NATIVEPATH instead of SHELLPATH… but thats just me 🙂

On PC, it is exactly the same thing.

---

<div class="post-metadata">

**Author:** ![Matthew\_Gardner](https://forum.xojo.com/user_avatar/forum.xojo.com/matthew_gardner/32/470_2.png) [@Matthew\_Gardner](https://forum.xojo.com/u/Matthew_Gardner)\
**Post date:** [February 17, 2017, 10:20pm UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/13 "2017-02-17T22:20:54Z")

</div>

Definitely just that machine - another at the same site works just fine.

IT will reinstall reader to see if that resolves the issue…ball in their court.

---

<div class="post-metadata">

**Author:** ![Aurelian\_N](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/b4bc9f/32.png) [@Aurelian\_N](https://forum.xojo.com/u/Aurelian_N)\
**Post date:** [February 24, 2020, 8:24am UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/14 "2020-02-24T08:24:45Z")

</div>

Hello guys, apparently I started to get same issue on the latest XOJO and on the latest build, I have 2 PDF’s both of them are opening fine in Preview if you double click on them, but when using .Launch one is opening, the other one does not , even if the file exists and it works well on the OS side, Xojo app side simply stops working .

Any ideas on this ?

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [February 24, 2020, 8:49am UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/15 "2020-02-24T08:49:13Z")

</div>

The command to use in the latest Xojo is `FolderItem1.Open(True)` (API2).

As RN said, `FolderItem1.Launch` is deprecated.

---

<div class="post-metadata">

**Author:** ![Aurelian\_N](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/b4bc9f/32.png) [@Aurelian\_N](https://forum.xojo.com/u/Aurelian_N)\
**Post date:** [February 24, 2020, 8:50am UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/16 "2020-02-24T08:50:39Z")

</div>

[quote=476530:@Emile Schwarz]The command to use in the latest Xojo is `FolderItem1.Open(True)` (API2).

As RN said, `FolderItem1.Launch` is deprecated.[/quote]  
Well deprecated but it still works on other files so I guess I’ll have to try 2.0 thanks for that.

---

<div class="post-metadata">

**Author:** ![Aurelian\_N](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/b4bc9f/32.png) [@Aurelian\_N](https://forum.xojo.com/u/Aurelian_N)\
**Post date:** [February 24, 2020, 8:53am UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/17 "2020-02-24T08:53:31Z")

</div>

Well apparently with .Open I get the following error while wrapping it with Try / Catch

> [@](#):
>
> There was an error : The application this is not ok.pdf could not be launched because a miscellaneous error occurred (OSStatus -36).

Anybody know what OSStatus -36 is ?

Thanks

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [February 24, 2020, 8:55am UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/18 "2020-02-24T08:55:09Z")

</div>

Run Disk Utilities.

Where is stored that file, in an embeded hard disk, an external hard disk, a local NAS, some kind of cloud, something else not disclosed ?

-36, in the old time, was I/O error, now ?

---

<div class="post-metadata">

**Author:** ![TomE](https://forum.xojo.com/user_avatar/forum.xojo.com/tome/32/583_2.png) [@TomE](https://forum.xojo.com/u/TomE)\
**Post date:** [February 24, 2020, 9:15am UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/19 "2020-02-24T09:15:57Z")

</div>

[quote=476535:@Aurelian Negrea]  
Anybody know what OSStatus -36 is ?[/quote]  
From CarbonCore/MacErrors.h

> [@](#):
>
> ioErr = -36, /_I/O error (bummers)_/

Not really helpful I guess

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [February 24, 2020, 9:30am UTC](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159/20 "2020-02-24T09:30:15Z")

</div>

> [@476537:@Thomas Eckert](#):
>
> Not really helpful I guess

Yes, not really helpfull. What do you do in that case ?

[Next page](https://forum.xojo.com/t/folderitem-launch-does-not-launch-pdf/36159.md?page=2)
