Trying to create a vpn connection as a service in windows

Hi there,

I am trying to get VPN to connect at boot by adding it as a service.

Althought knowing a fair amount about server and networking, I am alien to scripting - so this might sound but i need some pointers with this as to what to do.

To add the service I opened cmd and typed this;


I typed this;
H:\>sc.exe create "Heavens-end" binPath= "C:\WINDOWS\system32\rasdial.exe"

and got this;
Creates a service entry in the registry and Service Database.
SYNTAX:
sc create [service name] [binPath= ] <option1> <option2>...
CREATE OPTIONS:
NOTE: The option name includes the equal sign.
type= <own|share|interact|kernel|filesys|rec>
(default = own)
start= <boot|system|auto|demand|disabled>
(default = demand)
error= <normal|severe|critical|ignore>
(default = normal)
binPath= <BinaryPathName>
group= <LoadOrderGroup>
tag= <yes|no>
depend= <Dependencies(separated by / (forward slash))>
obj= <AccountName|ObjectName>
(default = LocalSystem)
DisplayName= <display name>
password= <password>

So (me being fairly alien to this) typed this;
sc.exe create "VPN NAME" binPath= "C:\WINDOWS\system32\rasdial.exe" type=”start” =”boot” error=”normal” binPath=”BinaryPathName” group=”LoadOrderGroup” tag=”yes” obj=”matt” DisplayName=”matt” password=”password”

But cant get t to work
jonathanduane2010Asked:
Who is Participating?
 
gheistCommented:
rasdial is not service executable itself.
you have to use srvany.exe
0
 
Al JeeCommented:
Well, I have no experience in scripting but the below [in bold] looks wrong. What equals "boot"?

"C:\WINDOWS\system32\rasdial.exe" type=”start” =”boot” error=”normal” binPath=”BinaryPathName” group=”LoadOrderGroup” tag=”yes” obj=”matt” DisplayName=”matt” password=”password”
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.