Execute Desktop Icon

T

TCronin

I have an icon set up on my desktop to establish a dial-up network connection
with a remote computer. I would like to be able to execute it from my code,
but there is no obvious program to run with a Shell command. Is there a way
to access this?
 
B

Brian

TCronin said:
I have an icon set up on my desktop to establish a dial-up network connection
with a remote computer. I would like to be able to execute it from my code,
but there is no obvious program to run with a Shell command. Is there a way
to access this?

The command you want to Shell is "rasdial". Open a command window and type
"rasdial /?" to get usage info.
 
T

TCronin

I've been playing with the rasdial command and it seems to be what i need,
however, when i try to execute it with the Shell command, i see a DOS window
open and immediately close before anything happens. Since i use the Shell
command successfully for other things, i believe i call it correctly. Is
there something about the rasdial command that requires me to do something
differently? Thanks for your help.

Tim
 
B

Brian

TCronin said:
I've been playing with the rasdial command and it seems to be what i need,
however, when i try to execute it with the Shell command, i see a DOS window
open and immediately close before anything happens. Since i use the Shell
command successfully for other things, i believe i call it correctly. Is
there something about the rasdial command that requires me to do something
differently? Thanks for your help.

Tim

The command window opens because rasdial needs to run in a command window.
This will not necessarily be true of other things that you run with Shell.
 
T

TCronin

Brian,
I expect the command window to open, my problem is that it immediately
closes before rasdial can execute. When i run other programs in the command
window, this does not happen. I've tried all the options shown for the
WindowStyle parameter. Is there something else I can try?

Thanks,
Tim
 
B

Brian

TCronin said:
Brian,
I expect the command window to open, my problem is that it immediately
closes before rasdial can execute. When i run other programs in the command
window, this does not happen. I've tried all the options shown for the
WindowStyle parameter. Is there something else I can try?

Thanks,
Tim

Oh I see, I was under the impression that the command was working OK. I can
Shell rasdial successfully, so it works in principle. Have you tried
executing your exact command directly in the command window (i.e. not by
using Shell) to make sure that your syntax etc is OK?
 
T

TCronin

Brian,
It looks like i was having trouble getting quotes around the connection name
properly. That seems to have taken care of it. Thanks for all your help

Tim
 

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