I am trying to open a CMD window and call dir in it.
r = Shell("cmd.exe", vbNormalFocus)
AppActivate r
SendKeys "dir", True 'put your exe path/name here instead of dir
SendKeys "{ENTER}"
It opens cmd.exe but doesn’t print dir in it or execute dir at all.
Why don’t you simple call:
This call will execute the dir command in cmd for you without playing with SendKeys.