Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
peter123
New Contributor

Shutdown FortiClient with cmd

Hello,

 

I want to shutdown the FortiClient with a cmd script. So how could I automate the following?

* Right-click on the FortiClient icon on the taskbar and select Shutdown FortiClient.

 

Best regards

Peter

3 REPLIES 3
maxs
New Contributor II

fortitray.exe --shutdown works however it needs to be executed in the logged-in user's session in with privileges (and the user needs to have local admin rights).

 

Doing this via SYSTEM(as a script) does not work.

rtichkule
Staff
Staff

Hello Peter,

 

 

You can use a CMD script to automate FortiClient shutdown by following these steps:

Open a text editor, such as Notepad.


Type the following command into the editor:

taskkill /im FortiClient.exe /t /f


The FortiClient process will be abruptly terminated by this command.

Use the.bat extension when saving the file.

Double-clicking the.bat file will start the script and end the FortiClient process.

JWIM
New Contributor

Hi there, should the below work for the VPN-only client? In practice it closes the console window, but the system tray and background processes persist, preventing uninstallation.


@rtichkule wrote:

Hello Peter,

 

 

You can use a CMD script to automate FortiClient shutdown by following these steps:

Open a text editor, such as Notepad.


Type the following command into the editor:

taskkill /im FortiClient.exe /t /f


The FortiClient process will be abruptly terminated by this command.

Use the.bat extension when saving the file.

Double-clicking the.bat file will start the script and end the FortiClient process.


 

Top Kudoed Authors