>>>>>But you still need that elevator to start from.
>>>>Yes, this looks definitely like a dead end.
>>>
>>>You give up too easily. There are several ways to launch processes with elevation mechanically / programmatically:
>>>
>>>
https://superuser.com/questions/42537/is-there-any-sudo-command-for-windows>>>
>>>
runas /noprofile /user:Administrator cmd
>>
>>That's not the point. I can build a VFP executable that must be ran as administrator, regardless of how it is launched. The problem is that to build a VFP app/exe/dll you must be inside the VFP IDE. And to build a OLEPUBLIC class, the VFP IDE itself must have been launched as administrator. So, back to square one.
>
>I posted how to do it yesterday.
>
>Run vfp9.exe as the target app with a command line parameter of your build program. Launch it using one of the elevation techniques. You can also create a shortcut to do this, and set it to Run As Administrator in its settings. Launching that shortcut will do it.
>
>
powershell Start-Process -verb runAs path-to-your.exe "-all -args -in -quotes"
Hi Rick, Antonio
Yes that's the spirit. Remember it's VFP, mostly anything goes. ;)
do the following (add paths to the filenames as you need)
create an prg file (let's say
MyElevatedCompile.prg)
MODIFY PROJECT "YourProject"
_VFP.ActiveProject.Build()
QUIT
create an fpw file (let's say
MyElevatedCompile.fpw)
RESOURCE = ""
COMMAND = DO "MyElevatedCompile.prg"
Now create a link like
"vfp9.exe" -t -c"MyElevatedCompile.fpw"
set to run as admin
or
from VFP, as Rick suggested
powershell Start-Process -verb runAs vfp9.exe "-t -cMyElevatedCompile.fpw"
I have no idea about powershells use of qoute in qoutes (as for the filename in -c), so be carefull with spaces
See that SET EXCLUSIVE is off as default, or the project will not open twice.
Lutz
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]