Fail to use Process.Start in Inventor 2025 (The specified executable is not a valid application for this OS platform or Access Denied)

Fail to use Process.Start in Inventor 2025 (The specified executable is not a valid application for this OS platform or Access Denied)

Maxim-CADman77
Advisor Advisor
1,375 Views
10 Replies
Message 1 of 11

Fail to use Process.Start in Inventor 2025 (The specified executable is not a valid application for this OS platform or Access Denied)

Maxim-CADman77
Advisor
Advisor

I used to use iLogic-code to open some PDF file with Process.Start method:

 

Dim invReleaseNum = Left(ThisApplication.SoftwareVersion.DisplayVersion, 4)
Dim pdfFilePath = "C:\Users\Public\Documents\Autodesk\Inventor " & invReleaseNum & "\Templates\ru-RU\Sample Part Template.pdf"
Process.Start(pdfFilePath) ' ... The specified executable is not a valid application for this OS platform.

 

But in Inventor 2025(.0.1) call for this method produces error '... The specified executable is not a valid application for this OS platform'.

What I'm missing?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Accepted solutions (1)
1,376 Views
10 Replies
Replies (10)
Message 2 of 11

Maxim-CADman77
Advisor
Advisor

 

Another sample of the issue (Access is denied)

Process.Start("c:\temp")

 

returns "An error occurred trying to start process 'c:\temp' with working directory 'C:\Program Files\Autodesk\Inventor 2025\Bin'. Access is denied."

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 3 of 11

WCrihfield
Mentor
Mentor

Hi @Maxim-CADman77.  This sounds like a new, temporary bug.  I saw this same thing in another recent forum post, from another user.  I suggested they switch that one line to using the iLogic 'ThisDoc.Launch()' method for now, until they get that issue fixed.  This worked for them, since their code was already using other iLogic functionality.  However, if your code does not have access to the stuff that is unique to iLogic, it may not even be a good temporary workaround for you.

ThisDoc.Launch(pdfFilePath)

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 11

Maxim-CADman77
Advisor
Advisor

ThisDoc.Launch works for PDF but can't be used to open folder.

Dear @MjDeck do you agree it is an Inventor 2025 API defect with Process.Start?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 5 of 11

WCrihfield
Mentor
Mentor

OK.  Just for added information in this case...

I just tested using it to open "C:\Temp" folder on my computer, from a new internal iLogic rule within a new, unsaved part file, in 2024.2.1 version of Inventor Pro, and it worked OK for me there.

ThisDoc.Launch("C:\Temp")

So this must be new behavior in 2025 so far.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 6 of 11

MjDeck
Autodesk
Autodesk
Accepted solution

Process.Start is not Inventor API. It's a .NET function.

Microsoft made a breaking change in Process.Start in .NET Core (.NET 8 is based on .NET Core). Search for ProcessStartInfo.UseShellExecute on this page.

 

Here's a good way to use the option in iLogic code:

Process.Start( New ProcessStartInfo(pdfFilePath) With {.UseShellExecute = True })

Mike Deck
Software Developer
Autodesk, Inc.

Message 7 of 11

Maxim-CADman77
Advisor
Advisor

@WCrihfield 

In fact this stopped work for folders since 2024.3.
If you'll look at the description of the Launch command it should not have either:

Launch

Launches a file based on the path and filename (including extension) provided. If a data file is specified, it opens in the application that has been associated with it. If you do not specify a complete path, iLogic looks for the file in the same folder as the Inventor document. You can also specify a relative name and path to the document folder.

Syntax

ThisDoc.Launch(“path\file.ext”)

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 8 of 11

MjDeck
Autodesk
Autodesk

Hi Wesley - as Maxim pointed out, using ThisDoc.Launch to open a folder was undocumented behavior. However, I think it would be possible to support it again in an update to 2025 and 2024. Please let me know if this is a high priority, or if you can use Process.Start instead.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 9 of 11

WCrihfield
Mentor
Mentor

No need to resurrect functionality that I never really used anyways.  I never really used 'ThisDoc.Launch' that much in the first place, then when I did use it, it was for opening a new / updated text file, PDF, or similar.  Nothing super important.  If I ever used it to open just a folder, it may have just been for a quick tests of functionality or similar, such as the example above.  I also used the Process.Start line (but usually with multiple lines of code) in more locations than ThisDoc.Launch, but similarly, only in temporary situations, or situations where its functionality was not that important.  If I ever needed to just show a folder, I used stuff like Inventor.FileDialog, OpenFileDialog, SaveFileDialog (or FolderBrowserDialog in some odd situations).

I only mentioned it here as a possible temporary workaround in a pinch, not as a long term or permanent solution.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 10 of 11

Wannes.V
Enthusiast
Enthusiast

Thanks, worked for me!

0 Likes
Message 11 of 11

jwong
Participant
Participant

This works for me. Thanks

0 Likes