 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
rgblair11 Guest
|
Posted: Wed Aug 11, 2004 1:16 am Post subject: first script - want more :) |
|
|
Hi, very new to this but I did manage to accomplish writing a very simple script to do the following (code is at the end of this message for all who are interested:
Start a VPN connection
Wait until connected
Open Oulook
Select the correct profile
Ok, now I need to tackle how to handle different scenerios. If the VPN connection is already started, for example, how can I skip the "start VPN portion" and just open outlook? I can't figure a way to detect the VPN session.
A quick tutorial to the syntax of the following would be helpful:
Start VPN piece
if VPN piece is started, goto Start Outlook
Start Outlook
Thank you so much. I'm looking forward to enhancing my scripting skills.
CODE
;START VPN CONNECTION
Send, {LWINDOWN}r{LWINUP}
WinWait, Run,
IfWinNotActive, Run, , WinActivate, Run,
WinWaitActive, Run,
Send, rasphone{ENTER}
WinWait, Network Connections,
IfWinNotActive, Network Connections, , WinActivate, Network Connections,
WinWaitActive, Network Connections,
send, {ENTER}
WinWait, Connect Barton Malow,
IfWinNotActive, Connect Barton Malow, , WinActivate, Connect Barton Malow,
WinWaitActive, Connect Barton Malow,
send, {ENTER}
WinWait, Connecting Barton Malow...,
WinWaitClose, Connecting Barton Malow...,
;
;START OUTLOOK AND SELECT PROFILE
Send, {LWINDOWN}r{LWINUP}
WinWait, Run,
IfWinNotActive, Run, , WinActivate, Run,
WinWaitActive, Run,
Send, outlook{ENTER}
WinWait, Choose Profile,
IfWinNotActive, Choose Profile, , WinActivate, Choose Profile,
WinWaitActive, Choose Profile,
Send, {UP}{ENTER}
WinWait, Enter Password,
IfWinNotActive, Enter Password, , WinActivate, Enter Password,
WinWaitActive, Enter Password,
Send, sarael{ENTER} |
|
| Back to top |
|
 |
Beastmaster
Joined: 15 Apr 2004 Posts: 182
|
Posted: Wed Aug 11, 2004 6:34 am Post subject: |
|
|
/profile profilename
Loads the specified profile. If your profile name contains a space, enclose the profile name in quotation marks.
/c ipm.note
Creates an e-mail message
-----
It looks that there's a chance to have a slight improvement in the Outlook section, based on the above syntax
| Code: | | Run, outlook /profile sarael /c ipm.note,,Max |
Please search the forum, keyphrase: outlook - to get more usefull details/links. Sorry have no clue how to detect an existing --> VPN connection.
To check for an existing dialup connection has already been discussed (and solved) ... |
|
| Back to top |
|
 |
Beastmaster
Joined: 15 Apr 2004 Posts: 182
|
Posted: Wed Aug 11, 2004 6:48 am Post subject: |
|
|
| What about to run a VPN shutdown and check for a confirmation message/popup ? |
|
| Back to top |
|
 |
Beastmaster
Joined: 15 Apr 2004 Posts: 182
|
Posted: Wed Aug 11, 2004 7:02 am Post subject: |
|
|
Check if the running VPN (Client) process is listed (in the TaskManager) using PSList [more...] |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Aug 11, 2004 2:25 pm Post subject: |
|
|
| Beastmaster wrote: | Check if the running VPN (Client) process is listed (in the TaskManager) using PSList [more...] |
I downloaded pslist, but how would I integrate it? I can run pslist.exe from the cmd prompt, see what's running, but I'm not sure how to have my script detect such a thing.
Thanks for you help, this is fun. |
|
| Back to top |
|
 |
Beastmaster
Joined: 15 Apr 2004 Posts: 182
|
Posted: Wed Aug 11, 2004 3:15 pm Post subject: |
|
|
Get all currently running processes and pipe them to a file e.g.
Run, %COMSPEC% /C pslist > C:\MyRunningProcesses.txt
Try to identify which is the name of your active! VPN Client process.
Based on that you can check specifically for that task/process the next time.
Run, %COMSPEC% /C pslist VPNProcessName > C:\MyRunningProcesses.txt
Then parse/read the outputfile to get the status of that process.
FileReadLine, Line, C:\MyRunningProcesses.txt, 1
MsgBox, %Line%
If the VPN process is active do wathever you want, e.g. send a file
If the process isn't active run the VPN process to get connected |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|