Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2005

Tip: Looking for answers? Try searching our database.

Probelm with Process and shortcut

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sebseb - 29 May 2005 01:22 GMT
Hello

I directly go to the problem, I create a Process, I set the Filename to the
full path and filename of a shortcut file (.lnk) and then I start my process,
like this :

Process p;
p.StartInfo.FileName = "path\\of\\my\\shortcut\\file.lnk";
p.Start();

My problem is that I always get a Win32Exception, with this message :
"The specified executable is not a valid Win32 application"

My shortcut is valid, it links to a PDF file and when I double-click on my
shortcut, I get my PDF document open in Acrobat, properly

Thank you in advance for any help
Jos=A9 Manuel Agero - 29 May 2005 22:35 GMT
Hello sebseb,

Try the following:

Process p;
p.StartInfo.FileName = "path\\of\\my\\shortcut\\file.lnk";
p.StartInfo.Verb="open";
p.Start();

Regards.

| Hello
|
[quoted text clipped - 13 lines]
|
| Thank you in advance for any help
sebseb - 29 May 2005 23:41 GMT
Thank you for answering, but the result is same... still not work, and still
the same exception with the same message

The French version of this message could be a help, maybe, since it's bit
different from the English message, it says : "Aucune application n'est
associée au fichier spécifié pour cette opération" which means "There is no
application associated to this file for this operation"

The English equivalent was : "The specified executable is not a valid Win32
application"

I still need help, my whole project will be affected if I can't resolve it,
I can bypass by changing strategy, but it will but much much less useful for
end-users :S

"José Manuel Agüero" wrote:

> Hello sebseb,
>
[quoted text clipped - 24 lines]
> |
> | Thank you in advance for any help
Jos=A9 Manuel Agero - 31 May 2005 18:15 GMT
Hello,

It works fine on my system. Have you tried it with different links or documents other than Acrobat Reader?

Regards.

| Thank you for answering, but the result is same... still not work, and still
| the same exception with the same message
[quoted text clipped - 41 lines]
| > |
| > | Thank you in advance for any help
sebseb - 01 Jun 2005 00:20 GMT
I tried with almost all famous format like MP3, images, videos, exe, etc...
it seems to work on all other systems, and it works perfectly at work, I
tested to see...
so it's obviously a problem on my computer but I just expected that someone
would have encountered such a problem and could tell me how to resolve.

But it's ok, I straped the problem writing a basic .lnk parser which get the
executable filename, then at starting, I first try the execution via Process
method into a try/catch bloc, if it fails, I set a flag telling that the
program have to work with the lnk parsing, and if it doesn't, the program
works with Process method. That works pretty fine, just first time is slow in
my case because of the exception throwing.

"José Manuel Agüero" wrote:

> Hello,
>
[quoted text clipped - 47 lines]
> | > |
> | > | Thank you in advance for any help

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.