how to run a DOS command

  • Thread starter Thread starter Rover
  • Start date Start date
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
 
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
 
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)
 
Back
Top