Re: Shell function return values

Tech-Archive recommends: Speed Up your PC by fixing your registry



I took the route of the scripting object because I read somewhere long ago
that the Shell command just uses the ShellExecute API declaration, so I
figured that seeing as he is having a full on crash, we might as well try
something that may not use the same API... there are other API calls to use,
I believe, but I thought it best just to try getting around it for now.

Jay Taplin

"DanS" <t.h.i.s.n.t.h.a.t@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:Xns974EE59F3B9A6idispcom@xxxxxxxxxxxxxxxxx
> "Jay Taplin" <jaytaplin@xxxxxxxxxxxxxxx> wrote in
> news:1137507353.974510.179210@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
>
>> Sounds like you have a problem... :-( While beneficial to fix it, try
>> going with a different technique to launch a file. The easiest,
>> without tapping into the API directly might be using the Windows
>> Script Host Object Model (set a reference to it in VB). Then use this
>> code to launch an app.
>>
>> Dim shell As IWshRuntimeLibrary.WshShell
>>
>> Set shell = New IWshRuntimeLibrary.WshShell
>>
>> shell.Run Chr$(34) & Filename & Chr$(34)
>>
>> Set shell = Nothing
>>
>> See the MSDN documentation:
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script
>> 56/html/6f28899c-d653-4555-8a59-49640b0e32ea.asp
>>
>
> So instead of adding one declare for ShellExecute, it should be done with
> a scripting object ?
>
> The ShellExecute API return value tells you success or the actual reason
> for the failure.
>
> ---------------------------------------------------------------------
> If the function fails, the return value is an error value that is less
> than or equal to 32. The following table lists these error values:
> 0
> The operating system is out of memory or resources.
>
> ERROR_FILE_NOT_FOUND
> The specified file was not found.
>
> ERROR_PATH_NOT_FOUND
> The specified path was not found.
>
> ERROR_BAD_FORMAT
> The .EXE file is invalid (non-Win32 .EXE or error in .EXE image).
>
> SE_ERR_ACCESSDENIED
> The operating system denied access to the specified file.
>
> SE_ERR_ASSOCINCOMPLETE
> The filename association is incomplete or invalid.
>
> SE_ERR_DDEBUSY
> The DDE transaction could not be completed because other DDE
> transactions were being processed.
>
> SE_ERR_DDEFAIL
> The DDE transaction failed.
>
> SE_ERR_DDETIMEOUT
> The DDE transaction could not be completed because the request timed
> out.
>
> SE_ERR_DLLNOTFOUND
> The specified dynamic-link library was not found.
>
> SE_ERR_FNF
> The specified file was not found.
>
> SE_ERR_NOASSOC
> There is no application associated with the given filename extension.
>
> SE_ERR_OOM
> There was not enough memory to complete the operation.
>
> SE_ERR_PNF
> The specified path was not found.
>
> SE_ERR_SHARE
> A sharing violation occurred.
> ------------------------------------------------------------------------


.



Relevant Pages

  • Re: "Driving" Linux Command Line from C# ?
    ... the usual Google search. ... Putty is great for manual work, but no API ... would be an SSH utility with an API but if it exists I haven't been ... Just be sure that you are sure about the shell on the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Microsoft and Trust Take 2
    ... It seems safe to say that the whole Shell structure ... The design of Shell functionality is very ... Windows 7 MS hopes to eliminate the "old" API altogether: ...
    (microsoft.public.vb.general.discussion)
  • Re: When is it safe to read from file system?
    ... the Shell API is *not* ready when my today-screen plug-in ... the shell, or a documented feature, I don't know. ... > API is ready. ... > this is a bug in the shell (unless it specifically documents that you ...
    (microsoft.public.pocketpc.developer)
  • Re: [Python-Dev] PEP 324: popen5 - New POSIX process module
    ... With the current API, you do this by checking if the return code is 127. ... The shell uses these return codes: ... the command was found but is not executable ... If you look at the popen5 implementation and PEP, ...
    (comp.lang.python)
  • Re: Save file Dialog API question
    ... > Is there a way to "force" a particular file extension when saving a file ... can reject the specified file name and force the dialog box to remain open ... API directly, as mr_unreliable said. ... Win32 API") for one relevant sample, but I am sure there are many other ...
    (microsoft.public.vb.winapi)