Private Sub Command1_Click()
'
will open a new maximized DOS window
Shell
("command.com"), vbMaximizedFocus
End Sub
Private Sub Command2_Click()
' clear the
clipboard
Clipboard.Clear
'
copy the string you want to pass to the clipboard, including
' the
Enter key (Chr$(13) = Enter Key)
' replace the "Dir *.*" below with the
string you want to pass.
Clipboard.SetText "Dir
*.*" + Chr$(13)
' set the focus to the Dos window.
"MS-DOS Prompt" is the title
' of the DOS window. If your Dos
window has other Title (The title
' is what written in the DOS window's title
bar), replace the "MS-DOS Prompt"
' below with your DOS window's
title.
AppActivate "MS-DOS Prompt"
' use the "SendKeys" function to send the string from
the clipboard to
' the DOS environment
SendKeys
"% ep", 1
End Sub