Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PM on new Win 10 PC
Message
De
22/01/2019 03:09:51
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
20/01/2019 08:38:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de projet
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Divers
Thread ID:
01665495
Message ID:
01665599
Vues:
78
>>>>>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 = ""  &&or anything you like
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.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform