×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Error: The Specified Executable Is Not A Valid Application For This OS

Error: The Specified Executable Is Not A Valid Application For This OS

Error: The Specified Executable Is Not A Valid Application For This OS

(OP)
I used code below open a PDF file but got a error said

The specified executable is not a valid application for this OS platform

But, if I open non-security folder as Process.Start(FILE_NAME) will be no problem.

How to fix it?


Dim FILE_NAME As String = "\\MYSERVER\ORDER\N1234.PDF"
Process.Start(FILE_NAME, "USERNAME", ToSecureString("MYPASSWORD"), "DOMAINNAME")

RE: Error: The Specified Executable Is Not A Valid Application For This OS

The overload version of Process.Start that you are using requires an executable file name as the first parameter, and .PDF is not an executable. From MSDN:

Start(String, String, SecureString, String)

Starts a process resource by specifying the name of an application, a user name, a password, and a domain and associates the resource with a new Process component.

Try using this constructor instead:

Start(String, String, String, SecureString, String)

Starts a process resource by specifying the name of an application, a set of command-line arguments, a user name, a password, and a domain and associates the resource with a new Process component.

Your code would be:

Dim FILE_NAME As String = "\\MYSERVER\ORDER\N1234.PDF"
Process.Start("Acrobat.exe", FILE_NAME, "USERNAME", ToSecureString("MYPASSWORD"), "DOMAINNAME")

You might need to provide the path to Acrobat.exe. To test this, open the Run box (Win+R) and enter Acrobat.exe. If Acrobat opens, you don't need the path in your code.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close