shell command.com

cmcgregor
cmcgregor used Ask the Experts™
on
I have this under a command button in Access

Private Sub Command100_Click()
Shell ("Command.com")
End Sub

I would like to to open DOS then start telnet and input the login and password.
Is this possible. If not the login and password at least start telnet.

Thanks in advance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:

Shell Environ$("COMSPEC")

will start Dos.  You'll have to pass the parameters to it for telnet.  I use this line for Net Send

Shell Environ$("COMSPEC") & " /c  NET SEND " & Me.lstUsers & " " & strMsg, 0

Hope this helps

Commented:
Shell "telnet -l <userName> <host>", vbNormalFocus

and if that doesn't work... to simply start telnet

Shell "telnet", vbNormalFocus

should work... at least it does on my machine (win xp pro)

Author

Commented:
bobbit31 where do i put the password?
Should you be charging more for IT Services?

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
shouldnt it be host, user, password since that is the order it asks you?

Commented:
go to command prompt and type:

telnet /?

it will give you the options (i don't know if you can pass password)

Author

Commented:
I put

Shell "telnet -l <128.135.1.32>", vbNormalFocus

but it open dos puts a -l and then closes the dos window. Is this right?

Commented:
no, just try:

Shell "telnet 128.135.1.32"

Author

Commented:
that works but the window is minimized. Any way to make it so it is open on the desktop?
Commented:
oops,

Shell "telnet 128.135.1.32", vbNormalFocus

Author

Commented:
Great thanks for your help

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial