Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Restarting computer
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01253129
Message ID:
01253486
Vues:
12
>Is it possible to restart the computer from VFP ?

Hi Moises,
try this code
*** look in the windows helpfile
*** take a look at "Command-line reference A-Z"

#define WINDOWSFOLDER 0x24
oShell = CreateObject("Shell.Application")
oFolder = oShell.NameSpace(WINDOWSFOLDER)

lcShutDown =  [Run ]+ADDBS(oFolder.Self.Path)+[system32\shutdown.exe -s -f -t 0]
IF MESSAGEBOX("Do you wont really to shutdown the PC ;o)?",4+32+256,"Shutdown") = 6
   EXECSCRIPT(m.lcShutDown)
ENDIF
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform