Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ShellExecute Problem
Message
De
23/09/2011 10:00:54
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
ShellExecute Problem
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01524461
Message ID:
01524461
Vues:
123
I am trying to come up with a way to capture the output of the Qwinsta command to a text file and then later parse it out to determine the current sessions open in RDS. To accomplish the first part I want to use shellexecute to run the command. For a brief time yesterday it worked and then something changed! I don't know what it is but I cannot even see a simple echo command.

Here is what I am trying:
#DEFINE SW_HIDE             0
DECLARE INTEGER ShellExecute ;
	    IN SHELL32.DLL ;
	    INTEGER nWinHandle,;
	    STRING cOperation,;   
	    STRING cFileName,;
	    STRING cParameters,;
	    STRING cDirectory,;
	    INTEGER nShowWindow

lcDir=GETENV("APPDATA")

lcCmd = GetEnv("comspec")
lccdm = "dir"

? lccmd, lcDir

lcPrm = " /c qwinsta >> mytest.txt"
lcPrm = lcDir+"\mytest.txt"
lcPrm = " echo hello >> mytest.txt "

=ShellExecute(0, "", lcCmd, lcPrm, lcDir, 0)
Thanks in advance

Glenn
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform