Network connections shortcut

M

Marco Maier

Sorry for my english
I need to execute a network connection shortcut (.lnk)
in my desktop from the command line but I can't.
I had tried to open the same window via command line but i failed
so I created a shortcut right clicking on my connection.
I don't want to use rasdial or rasdial -d because in the
first case I have to click a second time and in the second case
I can't disconnect. Is there a solution?
 
M

Marco Maier

Marco said:
Sorry for my english
I need to execute a network connection shortcut (.lnk)
in my desktop from the command line but I can't.
I had tried to open the same window via command line but i failed
so I created a shortcut right clicking on my connection.
I don't want to use rasdial or rasdial -d because in the

I meant rasphone
 
M

Marco Maier

Marco said:
I meant rasphone

I solved with this script:

set fso=CreateObject("Scripting.FileSystemObject")
set fsoFile =fso.CreateTextFile("_.cmd")
fsoFile.WriteLine "rasdial|find ""Connected""||(rasphone -d ADSL & goto :eof) "
fsoFile.WriteLine "rasphone"
fsoFile.Close
set wshShell = CreateObject("Wscript.Shell")
wshShell.Run("_.cmd"),0
wshShell.Run("ADSL.lnk"),0
wscript.sleep 2000
set fsoFile= fso.GetFile("_.cmd")
fsoFile.Delete
 

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