AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Paying For This] Creating a custom connection automatically

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
HCProfessionals



Joined: 18 Jun 2007
Posts: 166

PostPosted: Thu Dec 17, 2009 2:06 pm    Post subject: [Paying For This] Creating a custom connection automatically Reply with quote

I have been looking all over for a way to have autohotkey automatically create a dialup connection. Would it be possible by sending a command to rasphone.exe? Really need some help on this.

I will pay $20 by PayPal who can come up with this first.
Back to top
View user's profile Send private message
nulljector
Guest





PostPosted: Thu Dec 17, 2009 2:52 pm    Post subject: Reply with quote

When you load up rasphone.exe, does the Network Connections dialog come up do you have to create one from scratch?

This could be easy for me to do for you, just have to figure out what dialogs are coming up for you and what criteria you need to fill in.

Will check back in a bit.
Back to top
HCProfessionals



Joined: 18 Jun 2007
Posts: 166

PostPosted: Thu Dec 17, 2009 3:02 pm    Post subject: Reply with quote

I need this done in a command line sort of sense to automatically create the connection using script. I don't want to have to go through a wizard or anything to create a connection.
Back to top
View user's profile Send private message
nullJector



Joined: 17 Dec 2009
Posts: 15

PostPosted: Thu Dec 17, 2009 3:23 pm    Post subject: Reply with quote

HCProfessionals wrote:
I need this done in a command line sort of sense to automatically create the connection using script.

Yes I was about to ask you if you'd rather run it from a commandline.

It may take some correspondance from you (so I have an idea of your input criteria).

I'm going to familiarize myself with the command usage. Will work on it now and post in a bit..

ttys
Back to top
View user's profile Send private message
wooly_sammoth



Joined: 12 May 2009
Posts: 634
Location: Gloucester UK

PostPosted: Thu Dec 17, 2009 3:43 pm    Post subject: Reply with quote

I can give no guarantee that this will work as I have of way of testing it at the moment.

I had a look at this website for Rasphone and used the command for "Dial a RAS connection".

Code:

DetectHiddenWindows, On
Run, %comspec%, , Hide
ControlSend, , cd [directory where Rasphone is]{Enter}, cmd
ControlSend, , RASPHONE [-v] -f PhoneBook_file -d "PhoneBook_entry" > output.txt{Enter}, cmd


This will run a hidden command line, send the Rasphone command to it and save the output to a text file.

You could then use
Code:
Loop, Read, output.txt
to scan the text file for any errors or success etc.

If this doesn't work it should at least give some pointers.


Edit. Sorry nullJector, I didn't see your last post. Didn't mean to tread on your toes
Back to top
View user's profile Send private message Visit poster's website
nullJector



Joined: 17 Dec 2009
Posts: 15

PostPosted: Thu Dec 17, 2009 4:16 pm    Post subject: Reply with quote

wooly_sammoth wrote:
Edit. Sorry nullJector, I didn't see your last post. Didn't mean to tread on your toes

No worries Wink

HCProfessionals, I was able to create a dialup connection using the below script. I noticed that rasphone creates a custom ini file called *.pbk. Once this file is created, the system automatically creates the new new dialup connection.

Please run the script and let me know if you get a dialup connection in your network connections.
Also can you let me know what OS this will be used on (probably should have asked 1st) ?

Code:
pbkFile := A_AppDataCommon "\Microsoft\Network\Connections\Pbk\rasphone.pbk"
conName = New Custom Connection
phoneNum = 222-222-2222

pbkInfo=
(
[%conName%]
Encoding=1
Type=1
AutoLogon=0
UseRasCredentials=1
DialParamsUID=8180452
Guid=AFF52D61CB8A5E418C17BA5E6840F3DE
BaseProtocol=1
VpnStrategy=0
ExcludedProtocols=0
LcpExtensions=1
DataEncryption=8
SwCompression=1
NegotiateMultilinkAlways=0
SkipNwcWarning=0
SkipDownLevelDialog=0
SkipDoubleDialDialog=0
DialMode=1
DialPercent=75
DialSeconds=120
HangUpPercent=10
HangUpSeconds=120
OverridePref=15
RedialAttempts=3
RedialSeconds=60
IdleDisconnectSeconds=0
RedialOnLinkFailure=0
CallbackMode=0
CustomDialDll=
CustomDialFunc=
CustomRasDialDll=
AuthenticateServer=0
ShareMsFilePrint=0
BindMsNetClient=1
SharedPhoneNumbers=1
GlobalDeviceSettings=0
PrerequisiteEntry=
PrerequisitePbk=
PreferredPort=
PreferredDevice=
PreferredBps=0
PreferredHwFlow=0
PreferredProtocol=0
PreferredCompression=0
PreferredSpeaker=0
PreferredMdmProtocol=0
PreviewUserPw=1
PreviewDomain=0
PreviewPhoneNumber=1
ShowDialingProgress=1
ShowMonitorIconInTaskBar=1
CustomAuthKey=-1
AuthRestrictions=632
TypicalAuth=1
IpPrioritizeRemote=1
IpHeaderCompression=1
IpAddress=0.0.0.0
IpDnsAddress=0.0.0.0
IpDns2Address=0.0.0.0
IpWinsAddress=0.0.0.0
IpWins2Address=0.0.0.0
IpAssign=1
IpNameAssign=1
IpFrameSize=1006
IpDnsFlags=0
IpNBTFlags=1
TcpWindowSize=0
UseFlags=0
IpSecFlags=0
IpDnsSuffix=

NETCOMPONENTS=
ms_server=0
ms_msclient=1

MEDIA=serial
Port=COM1
ConnectBPS=0

DEVICE=modem
PhoneNumber=%phoneNum%
AreaCode=
CountryCode=1
CountryID=1
UseDialingRules=0
Comment=
LastSelectedPhone=0
PromoteAlternates=0
TryNextAlternateOnFail=1
HwFlowControl=0
Protocol=0
Compression=0
Speaker=1
MdmProtocol=0

)

FileAppend, % pbkInfo, % pbkFile

Return


Still kind of messy but I will clean it up for you if this part works Smile.

If all goes well, getting it to dial should be a peace of cake.

Let me know what happens and we can go from there.
Back to top
View user's profile Send private message
HCProfessionals



Joined: 18 Jun 2007
Posts: 166

PostPosted: Thu Dec 17, 2009 4:35 pm    Post subject: Reply with quote

[Changed] Read below

Last edited by HCProfessionals on Thu Dec 17, 2009 4:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
HCProfessionals



Joined: 18 Jun 2007
Posts: 166

PostPosted: Thu Dec 17, 2009 4:39 pm    Post subject: Reply with quote

Ok, i did get one!

Needs:

- Username
- Password
- Shortcut on desktop
- Option to choose modem/device
Back to top
View user's profile Send private message
nullJector



Joined: 17 Dec 2009
Posts: 15

PostPosted: Thu Dec 17, 2009 5:14 pm    Post subject: Reply with quote

HCProfessionals wrote:
Ok, i did get one!

Can you please confirm that you got a dialup connection with the above script I posted (just for my own clarity)?

Thanks,

Going to work on the UN, password, SC and Options next.

Will wait for your confirmation before continuing..
Back to top
View user's profile Send private message
HCProfessionals



Joined: 18 Jun 2007
Posts: 166

PostPosted: Thu Dec 17, 2009 5:43 pm    Post subject: Reply with quote

Sure did!
Back to top
View user's profile Send private message
nullJector



Joined: 17 Dec 2009
Posts: 15

PostPosted: Thu Dec 17, 2009 6:17 pm    Post subject: Reply with quote

HCProfessionals wrote:
Sure did!

Great Very Happy.

Please see PM for further details.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group