Set oShell = CreateObject("WScript.Shell")
oShell.Run "cmd /c c:"
This line executes perfectly fine. Now I need to enter a text.
For example: c:\users> "abcd"
How do I go about it in the already opened cmd prompt.
You must add & after each command and change cmd /c to cmd /k
Try like this :
Set oShell = CreateObject("WScript.Shell")
Command = "cmd /K cd /d c:\ & Dir & ping 127.0.0.1"
oShell.Run Command,1,True
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With