how to run a DOS command

R

Rover

I'm using A2K in Win XP Pro. On a command button push I want to run a
DOS command just like from a DOS window. e.g. c:>type test.txt >lpt1
What I'm really trying to do is print a text file from DOS not windows.
(Its a driver problem really and this is the only solution I can find).

I can use SHELL to run an application but I can't find how to run a DOS
command (like TYPE... see above).

TIA
Jim
 
R

Ron Weiner

Rover

Why not doing it from Access without shelling to DOS by using the filecopy
command. Should work just like redirecting the output of the type command
to the printer. Or at least this worked on my box.

filecopy "c:\test.txt", "lpt1:"

Ron W
 
V

Van T. Dinh

A quick example on my WinXP / AccessXP:

Shell "Cmd.exe /C copy " & _
"""C:\AutoExec.bat"" ""C:\AutoExec.tst"""

copies the file correctly on my PC.

HTH
Van T. Dinh
MVP (Access)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top