Jump to content

Recommended Posts

Posted

Hello,
I'm new here and please help me migrate this example of .bat in autoit

@echo off
echo Wait ...
taskkill /IM "ipsecc.exe" /t /f >nul 2>nul
ping 127.0.0.0 -n 5 >nul
start "Connecting..." /min /b "%ProgramFiles%\ShrewSoft\VPN Client\ipsecc.exe" -r "PROFILE" -u USERNAME -p PASSWORD -a >nul 2>nul

thank you in advance
Posted

Help file says:

RunAs ( "username", "domain", "password", logon_flag, "program" [, "workingdir" [, show_flag [, opt_flag]]] )

So you're trying to run nothing with user ipsecc.exe with domain d:\program files... :)

don't know the program you are using, but 

#include <process.au3>
_RunDos('"D:\Program Files\ShrewSoft\VPN Client\ipsecc.exe" -r "PROFILE" -u USERNAME -p PASSWORD -a')

or

ShellExecute ("D:\Program Files\ShrewSoft\VPN Client\ipsecc.exe", '-r "PROFILE" -u USERNAME -p PASSWORD -a', ""D:\Program Files\ShrewSoft\VPN Client\ipsecc.exe")

should be the right direction.

Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL)

Posted (edited)

thanks, 
the program opens, but does not automatically take the username and password - it must be entered
thanks a lot

Edited by Jos
removed formatting

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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