How do I run a DOS program (with arguments) inside the Word?

S

sharmanxz

I am running a DOS program in Word by using shell("D:\calc<D:\xx.rrr",1),
where xx.rrr is a input file required by the DOS program calc.exe. It worked
under Windows 2000. It doesn't work under Windows XP Microsoft Word 2003.
 
K

Karl E. Peterson

sharmanxz said:
I am running a DOS program in Word by using
shell("D:\calc<D:\xx.rrr",1), where xx.rrr is a input file required
by the DOS program calc.exe. It worked under Windows 2000. It doesn't
work under Windows XP Microsoft Word 2003.

You can't use redirection within a Shell statement without invoking a
secondary command processor.

Ex:
MyCmd = "d:\calc < d:\xx.rrr"
Call Shell(Environ("comspec") & " /c " & MyCmd, vbNormalFocus)
 

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