Jump to content

need help with simple syntax

Recommended Posts

REAL simple......as in noob.....big time. :ph34r:

All i want to do is launch my dial up connection. So either i need to start the shortcut for it on the desktop, or if it's not too complicated run it directly. I tried the "run" command, but it only works with the exe, not a shortcut. And since the connection file isn't an exe type file, i don't know how to even start, which is why i tried to make the desktop shortcut work. This should be a simple one for you guys. Thanks in advance.....

Link to comment
Share on other sites

Thanks. I have V2 so i guess i can't use that AI code, but i can use a bat file. But will that code work with V2 also? Because i may end up wanting to use that if possible. Also, is there a syntax to do the opposite......CLOSE the connection?

Edited by dazco
Link to comment
Share on other sites

  • Developers

Don't see any reason why it shouldn't work in V2 as well .. only the run command needs to be code differently...

-h switch does the disconnection according the rasphone /? command ....

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
Live for the present,
Dream of the future,
Learn from the past.

Link to comment
Share on other sites

Ok, i tried all the suggestions in the thread JdeB linked, and while i couldn't get any of the autoit codes to work in V2, i was able to get one of the dos lines to work. But heres the problem......i want the bat file to start my connection plus 2 progs.

If i make a bat with just the connection command it works. If i make one with just the 2 progs they work. But if i make one with the 2 progs and the command to start the dial-up, they don't all work. if the dial-up command is listed first, it'll connect but the progs won't start and the dos windows stays on screen till i close it. (it disappears by itself after i'm connected when i use a bat with just the dial-up command)

if i make it with the progs listed first, the dial-up doesn't start and again the dos window stays up. Is there a way to run all 3 of them from a bat file so they all start up and the dos window disappears when they're done? In 98 there was a check box in the bat file shortcut you could check to make the window close by itself when finished. But nothing like that in XP, tho it does close by itself like i said when just the dial-up command is in the bat.

Link to comment
Share on other sites

Beastmaster is on the right track: look here for info

OOPS... this is version3 code someone can convert it for you to version2....

I could only test the command on XP, but I think I have the syntax right for Windows 9x/Me... If your connection name contains spaces you might need to put extra quotes around it.

$connectionName = "Earthlink";name of the connection itself

If @OSType = "WIN32_NT" Then
;command for Windows NT/2000/XP
   Run('rasphone -d ' & $connectionName)
;command for Windows 9x/Me
   Run('RUNDLL32.EXE RNAUI.DLL,RnaDial ' & $connectionName)

Note: You either need to set the properties of your connection to not prompt you for username/password/number OR need to do the following:

WinWait("Connect " & $connectionName)
ControlClick("Connect " & $connectionName, "", "&Dial")
Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

Ok, i gotta admit i'm an idiot when it comes to autoit or dos code. So the best i've been able to do so far with all you guys have shown me is this syntax i used in a bat file......

"C:\download progs\mailcheck\mailcheck.exe"

"C:\Program Files\Zone Labs\ZoneAlarm\zonealarm.exe"

rasphone.exe -d A4L

A4L being the name of the dialup connection i have of course. Anyway, what happens when i launch it is this. The mailcheck program comes up and is loaded just fine. But it stops there and the next one, zonealarm doesn't load and the dos window is up. Nothing happens after that. That is UNTIL i close the mail program, at which time zonealarm then loads but the dialup doesn't start ! Then if i close the zonealarm prog, the dialip connection begins.

So i'm guessing there is some kind of syntax i need to put after each entry?

This is XP by the way.

Link to comment
Share on other sites

By default, batch files wait until an application completes (opens and closes) before running the next one. You can overcome this behavior by using cmd /c start "" <programName>

Try the following:

cmd /c start "" "C:\download progs\mailcheck\mailcheck.exe"
cmd /c start "" "C:\Program Files\Zone Labs\ZoneAlarm\zonealarm.exe"
cmd /c start "" rasphone.exe -d A4L

Hope that works

Edit: Since this is a batch file you can probably omit cmd /c and simply use start "" ...

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

Worked like a charm CyberSlug, thank you ! Now i'm gonna try a bat to close them all using whats been posted here. If you have any ideas for that, i'm probably gonna need em ! Thanks a mill.....

Link to comment
Share on other sites

Maybe it makes no sense at all, but in case you've to use (dialup) login details at a batch file you'll offer them to everyone who's access to it (worse case, the guy who's left a virus/worm on your box :ph34r: )

So compiling the AutoIt 2 script seems not to be a bad idea.

Following CyberSlug's advise the AutoIt 2 code should look like this:

Run, %COMSPEC% /c start "" "C:\download progs\mailcheck\mailcheck.exe"

Run, %COMSPEC% /c start "" "C:\Program Files\Zone Labs\ZoneAlarm\zonealarm.exe"

Run, %COMSPEC% /c start "" rasphone.exe -d A4L

Have a try.


MHO: On your way to become an AutoIt 3 professional you could have a look at AutoHotkey (AHK). If you already know how to use AutoIt 2, you know how to use AHK as well. If you're able to use the advanced features of AHK - you're definitely qualified to handle the AutoIt 3 syntax and become an AutoIt 3 professional like CyberSlug :(

Have phun.

Link to comment
Share on other sites

Well, i appriciate it, tho i already got it working with bat files. But i'll copy that syntax and save it for future use . Maybe i'll give it a shot just to see what the difference is in how it works verses the dos one.

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...