Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Issuing NT/DOS commands without the ! (hide the window)
Message
 
 
To
14/04/1998 11:09:58
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00088829
Message ID:
00091808
Views:
41
>Michael,
>
>Thanks again, but this time what I was shooting for is "how do I call built-in DOS/NT commands," and EDIT is a stand-alone command. I'm more interested in how to call things like TYPE or ASSOC or PUSHD.
>
>DO I call COMMAND.COM as my file and pass the DOS command I want to call as a parm?
>
>On a related note, some of the things this legacy system does is to make lots of calls like this:
>
>!TYPE FOO.DAT >LPT1:
>
>Is there a better way to do this these days? I'm concerned about the forcing of output to LPT1: in a system based on NT -- seems too outdated, but it still works, and I'm not so up on DOS that I'm sure of how to preserve the functionlaity while hauling it out of the ston ages.
>
>-- jas

I don't believe you can use the built-in commands like type or dir. I could not get them to work and since there is no file to "open" I suspect you can't. Maybe one of UT's resident API guru's can shed some light or provide a better approach? You could create a batch file containing the DOS command and then execute it. Checkout VFP's FCREATE and FWRITE commands for creating the batch file.

As far as your "!TYPE FOO.DAT >LPT1:" example, there are a lot of possible options. One would be to use low level file access (FOPEN, FGETS or FREAD) to get the data and then send to printer through VFP.

Mike
Michael McLain
Previous
Reply
Map
View

Click here to load this message in the networking platform