AutoHotkey Community

It is currently May 27th, 2012, 12:39 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: December 17th, 2009, 3:06 pm 
Offline

Joined: June 19th, 2007, 12:04 am
Posts: 174
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2009, 3:52 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2009, 4:02 pm 
Offline

Joined: June 19th, 2007, 12:04 am
Posts: 174
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2009, 4:23 pm 
Offline

Joined: December 17th, 2009, 4:20 pm
Posts: 15
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2009, 4:43 pm 
Offline

Joined: May 12th, 2009, 2:37 pm
Posts: 640
Location: Gloucester UK
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2009, 5:16 pm 
Offline

Joined: December 17th, 2009, 4:20 pm
Posts: 15
wooly_sammoth wrote:
Edit. Sorry nullJector, I didn't see your last post. Didn't mean to tread on your toes

No worries ;)

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 :).

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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2009, 5:35 pm 
Offline

Joined: June 19th, 2007, 12:04 am
Posts: 174
[Changed] Read below


Last edited by HCProfessionals on December 17th, 2009, 5:39 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2009, 5:39 pm 
Offline

Joined: June 19th, 2007, 12:04 am
Posts: 174
Ok, i did get one!

Needs:

- Username
- Password
- Shortcut on desktop
- Option to choose modem/device


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2009, 6:14 pm 
Offline

Joined: December 17th, 2009, 4:20 pm
Posts: 15
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..


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2009, 6:43 pm 
Offline

Joined: June 19th, 2007, 12:04 am
Posts: 174
Sure did!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2009, 7:17 pm 
Offline

Joined: December 17th, 2009, 4:20 pm
Posts: 15
HCProfessionals wrote:
Sure did!

Great :D.

Please see PM for further details.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Leef_me, Ohnitiel, XstatyK and 18 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group