Skip to main content
wigi
New Member
April 4, 2020
Question

FortiClient from the command line interface

  • April 4, 2020
  • 4 replies
  • 35741 views

Hello all,

 

I would like to start a VPN connection through the FortiClient from command line interface.

It all works fine manually but I cannot get the syntax right, it seems. Please see the attached picture.

 

Using online resources, I think it should be someting along these lines:

 

"C:\Program Files\Fortinet\FortiClient\FortiClient.exe" connect -s "Aexis VPN" -u wgielis:MY_PASSWORD

 

Version: 6.0.0.0067

 

https://kb.fortinet.com/kb/documentLink.do?externalID=FD41256

https://forum.fortinet.com/tm.aspx?m=123014

 

Thanks a lot for any pointers !

 

Wim

    4 replies

    jesusabdiarai
    New Member
    February 2, 2021

    Hello, I have a similar problem, could you tell me what was your solution?

    wigi
    wigiAuthor
    New Member
    February 2, 2021

    Hello,

     

    No response received and I also found no solution myself. Let me know if you do.

    Parad0x92
    New Member
    January 16, 2023

    If the error is:guimessenger.png
    Error: Cannot open C:\Program Files\Fortinet\FortiClient\resources\app.asar\assets\js\guimessenger64.node: Error: No se puede encontrar el módulo especificado.
    --------
    EDIT1:
    As it cannot find app.asar\assets\js\guimessenger64.node

    I tried to backup "app.asar" file and copying "app.asar.unpacked" as it's a folder:


    CD "C:\Program Files\Fortinet\FortiClient\resources"

    COPY app.asar app_old.asar

    DEL app.asar

    MD app.asar\assets\js

    COPY app.asar.unpacked\assets\js\guimessenger64.node app.asar\assets\js\guimessenger64.node



    It stopped showing the error, but still doesn't work:
    guimessenger2.png

    NOTES: (Still trying to figure out what's wrong with it)
    In File: "app.asar" Line: 62027 you got this code which means you require "app.asar.unpacked/assets/js/guimessenger64.node".. but the command invokes
    "app.asar/assets/js/guimessenger64.node"
    guimessenger3.png

    ...

    ---------------------------
    EDIT2:
    After a while trying to figure it out... i already noticed i was using old C++ redistributables... So let's start again...

    1.- Install last c++ redistributables (VC_redist.x64)

    After that you may get next error:
    guimessenger4.png


    2.- Then you can: FortiClientFortiClient.exe connect -s "CLIENT" -u user:passwd
    3.- BUT you CANNOT: "C:\Program Files\Fortinet\FortiClientFortiClient.exe" connect -s "CLIENT" -u user:passwd

    4.- So create a system envoirment variable to solve it.

    4.-(FIX 2) Execute it as follows:


    cd "C:\Program Files\Fortinet\FortiClient" & FortiClient.exe connect -s "CLIENT" -u user:password

    FortiClient will pop up, but connection won't work... anyways if you go by interface and connect/disconect from the VPN, you'll see all events returning info by the prompt...

    sgupta
    New Member
    June 19, 2023

    In my case, the connection shows up when I use the command line option, but traffic is not passing. Only Packets sent is increasing, but zero packets received. When I use the installed forticlient (EMS managed) to connect to the same tunnel it works fine without any issues. I am using 7.0.8 for both the forticlient GUI as well as the forticlient tools

    lolo101
    Explorer
    July 3, 2023

    my config :

    Ubuntu 23.04

    Forticlient 7.0.8.0292

     

    Similar issue : 0 bytes received.

    Even when I disconnect the VPN I receive no more bytes. I have to restart the PC to have my connection up again

    sjuffe
    New Member
    April 24, 2025

    This seems to be an older topic but I had this working then after a client change I got the same error.  I looked at my file and noticed errant quotes.  I changed my to the below sample.  I would start with an open " and then end with a closing " and none in the middle.

     

    "C:\Program Files\Fortinet\FortiClient\FortiClient.exe VPN NAME GOES HERE"

     


    @wigi wrote:

    Hello all,

     

    I would like to start a VPN connection through the FortiClient from command line interface.

    It all works fine manually but I cannot get the syntax right, it seems. Please see the attached picture.

     

    Using online resources, I think it should be someting along these lines:

     

    "C:\Program Files\Fortinet\FortiClient\FortiClient.exe" connect -s "Aexis VPN" -u wgielis:MY_PASSWORD

     

    Version: 6.0.0.0067

     

    https://kb.fortinet.com/kb/documentLink.do?externalID=FD41256

    https://forum.fortinet.com/tm.aspx?m=123014

     

    Thanks a lot for any pointers !