Re: Shell or ShellExecute powercfg.cpl doesn't fire
- From: "Bob Butler" <tiredofit@xxxxxxxxxx>
- Date: Mon, 15 Aug 2005 09:45:42 -0700
"Ted" <2000@xxxxxxxxxx> wrote in message
news:%23fCyvaboFHA.1044@xxxxxxxxxxxxxxxxxxxx
>> does GS$ end with a trailing "\"? Yes
>
> >Have you tried using vbNullString instead
>> of "" for the parameters/directory?
> This does not work
> lRetVal = ShellExecute(0, "Open", GS$ & "powercfg.cpl", vbNullString,
> "", 1)
>
>> You should also post you Declare statement for the ShellExecute call.
>
> Option Explicit
> Private Declare Function ShellExecute Lib "shell32.dll" Alias
> "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String,
> ByVal lpFile As String, ByVal lpParameters As String, ByVal
> lpDirectory As String, ByVal nShowCmd As Long) As Long
Don't see anything obviously wrong unless it is the lpDirectory; try
lRetVal = ShellExecute(0, "open", GS$ & "powercfg.cpl", vbNullString,
vbNullString, 1)
and check the values of lRetVal and Err.LastDllError to see what, if any,
error code is coming back
--
Reply to the group so all can participate
VB.Net: "Fool me once..."
.
- References:
- Re: Shell or ShellExecute powercfg.cpl doesn't fire
- From: Bob Butler
- Re: Shell or ShellExecute powercfg.cpl doesn't fire
- Prev by Date: Re: Automating Internet Explorer
- Next by Date: Re: Shell or ShellExecute powercfg.cpl doesn't fire
- Previous by thread: Re: Shell or ShellExecute powercfg.cpl doesn't fire
- Next by thread: Re: Shell or ShellExecute powercfg.cpl doesn't fire
- Index(es):
Relevant Pages
|
Loading