In my VFP9 application I use yy='explorer /e,/select, '+x2 where x2 is a
variable folder. Then I issue RUN /N &yy. I would like to know if there is
another way of invoking the explorer and have it open a given folder. I ask
because my whole application runs with impersonation, that means that the
user behind running the application is not the same as the Windows user.
With that impersonation my command described above does not do anything. It
doesn't give an error, but it does not open any explorer, nothing.


TiA
Walter

Re: Is there a VFP command without using RUN ? by brferg

brferg
Thu May 08 19:34:42 CDT 2008

On May 9, 7:01=A0am, "WP" <wp_nos...@fibertel.com.ar> wrote:
> In my VFP9 application I use =A0 =A0yy=3D'explorer /e,/select, '+x2 where =
x2 is a
> variable folder. Then I issue RUN /N =A0 &yy. I would like to know if ther=
e is
> another way of invoking the explorer and have it open a given folder. I as=
k
> because my whole application runs with impersonation, that means that the
> user behind running the application is not the same as the Windows user.
> With that impersonation my command described above does not do anything. I=
t
> doesn't give an error, but it does not open any explorer, nothing.
>
> TiA
> Walter

Hi, one way I use (from an earlier post) is to call a program with a
parameter for Url as below:

PARAMETER loption
DO CASE
CASE loption=3D1
MyURL=3D"http://www 1 etc/"
CASE loption=3D2
MyURL=3D"http://www 2 etc"
ENDCASE

aObj=3DCreateObject("InternetExplorer.Application")
aObj.visible =3D .T.
aObj.navigate("&MyURL")
*aObj.quit && will shut down IE

RETURN

Re: Is there a VFP command without using RUN ? by Stefan

Stefan
Fri May 09 01:04:12 CDT 2008


"WP" <wp_nospam@fibertel.com.ar> schrieb im Newsbeitrag
news:%23ejp76UsIHA.3616@TK2MSFTNGP06.phx.gbl...
> In my VFP9 application I use yy='explorer /e,/select, '+x2 where x2 is a variable
> folder. Then I issue RUN /N &yy. I would like to know if there is another way of
> invoking the explorer and have it open a given folder. I ask because my whole
> application runs with impersonation, that means that the user behind running the
> application is not the same as the Windows user. With that impersonation my command
> described above does not do anything. It doesn't give an error, but it does not open any
> explorer, nothing.

In addition to Bruce's comment - you can use ShellExecute()
instead of !|RUN.

Your case is a special one though, since explorer.exe refuses
to "run as..." in a secondary instance with elevated privileges.
On WinXP with Internet Explorer 6, you can start iexplore.exe
instead.
With IE7, that does not work either but you can use the /separate
switch, e.g.:
%windir%\system32\runas.exe /user:admin "explorer /separate,c:\"



hth
-Stefan




--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------



Re: Is there a VFP command without using RUN ? by Krister

Krister
Sun May 11 04:27:41 CDT 2008

I use
ShellExec(X2)

Function ShellExec
Lparameter lcLink, lcAction, lcParms
lcAction = Iif(Empty(lcAction), "Open", lcAction)
lcParms = Iif(Empty(lcParms), "", lcParms)

Declare Integer ShellExecute ;
IN SHELL32.Dll ;
INTEGER nWinHandle, ;
STRING cOperation, ;
STRING cFileName, ;
STRING cParameters, ;
STRING cDirectory, ;
INTEGER nShowWindow

Declare Integer FindWindow ;
IN WIN32API ;
STRING cNull,String cWinName

Return ShellExecute(FindWindow(0, _Screen.Caption), ;
lcAction, lcLink, ;
lcParms, Sys(2023), 1)

/Krister

"WP" <wp_nospam@fibertel.com.ar> skrev i meddelandet
news:%23ejp76UsIHA.3616@TK2MSFTNGP06.phx.gbl...
> In my VFP9 application I use yy='explorer /e,/select, '+x2 where x2 is
> a variable folder. Then I issue RUN /N &yy. I would like to know if
> there is another way of invoking the explorer and have it open a given
> folder. I ask because my whole application runs with impersonation, that
> means that the user behind running the application is not the same as the
> Windows user. With that impersonation my command described above does not
> do anything. It doesn't give an error, but it does not open any explorer,
> nothing.
>
>
> TiA
> Walter
>