Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hide the commandbox
Message
From
06/01/2011 14:03:42
 
 
To
06/01/2011 07:55:38
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01494890
Message ID:
01495013
Views:
90
If you're trying to use command-line I/O redirection operators, then perhaps you might want to have the command processor take care of it? Here's a minor variation on Tore's code:
#DEFINE SW_HIDE             0

DECLARE Long ShellExecute IN "Shell32.dll" ;
	Long hwnd, String lpVerb, String lpFile, ;
	String lpParameters, String lpDirectory, Long nShowCmd

lcOldDir=Fullpath(Curdir())  && remember original folder
MKDIR C:\TEST                && Make sure directory exists.
lcDir = "c:\test"            && directory in which command is executed
lcCmd = GetEnv("comspec")
lcPrm = "/c echo hello >> mytest.txt"
=ShellExecute(0, "", lcCmd, lcPrm, lcDir, SW_HIDE)

cd (lcOldDir)
Basically the above should be similar to:
CD \test
RUN echo hello >> mytest.txt
Previous
Reply
Map
View

Click here to load this message in the networking platform