Re: Shell function return values
- From: "Jay Taplin" <jtaplin@xxxxxxxxxxxxxxx>
- Date: Tue, 17 Jan 2006 22:50:20 -0500
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.
> ------------------------------------------------------------------------
.
- References:
- Re: Shell function return values
- From: Nospam
- Re: Shell function return values
- From: Nospam
- Re: Shell function return values
- From: Jay Taplin
- Re: Shell function return values
- From: DanS
- Re: Shell function return values
- Prev by Date: Re: Shell function return values
- Next by Date: Re: NTFS ownership
- Previous by thread: Re: Shell function return values
- Next by thread: Re: Shell function return values
- Index(es):
Relevant Pages
|