Skip to content

Instantly share code, notes, and snippets.

@AndrewMast
Last active November 21, 2024 23:25
Show Gist options
  • Save AndrewMast/742ac7e07c37096017e907b0fd8ec7bb to your computer and use it in GitHub Desktop.
Save AndrewMast/742ac7e07c37096017e907b0fd8ec7bb to your computer and use it in GitHub Desktop.
Commands to disable Riot Vanguard when you aren't playing Valorant

Commands to temporarily stop Riot Vanguard

As oddly as it sounds, people actually do other things on their computer than play Valorant. I've put together a few commands to turn off Riot Vanguard for when you aren't playing Valorant.

Proof that I'm not hacking your computer

On Riot's support website for Valorant, they list two commands in the third step in the process of manually uninstalling Riot Vanguard. Link to the page. These commands are sc delete vgc and sc delete vgk. These commands are telling Windows Services (known to the command line as sc) to delete two services (vgc and vgk). My commands simply disable these services from starting next time you start your computer by changing their configuration to disabled (ie. sc config vgc start= disabled)

Commands for people who don't know how commands work

If you don't know how commands work or you just want the easiest way to disable and enable Vanguard, I have created a few files for the best experience:

How to get these files:

Click here to download all of the files (same as hitting "Download ZIP" at the top right-ish of the page)

OR

  1. Click on one of the links above to scroll down to the file
  2. Right click on the "Raw" button for the file
  3. Select "Save Link As..." or "Download File As..."
  4. Before saving, make sure to set the "Save as type" field to All Files (*.*) to ensure that the file is saved with the extension .vbs (very important)

How these files work:

These files run the same commands provided below, but asks you to run the command as administrator first. Let's dissect the code, eh? Take disable_vanguard.vbs for example:

Call CreateObject("Shell.Application").ShellExecute("cmd.exe", "/c ""sc config vgc start= disabled & sc config vgk start= disabled""", "", "runas")

If you noticed, in the middle of this code you can see sc config vgc start= disabled & sc config vgk start= disabled which is the exact command that I provide for the more "experienced" people (see below). The Call CreateObject("Shell.Application").ShellExecute part of the code gets ready to launch command prompt. Then cmd.exe is given to this so it can be opened, and /c ""{...}"" simply tells command prompt what command to run (I left out the command on purpose). Finally, runas tells the code that it needs to ask you for permission to run the command as an administrator.

The restart command

If you choose to use the command to restart your computer, shutdown /r /f /t 00 is included in the command. shutdown tells command prompt that you want to shutdown your computer, but /r tells it to restart. /f tells it to close all open programs and /t 00 tells it to shutdown right away.

The close command

If you choose to use the command to stop Vanguard, net stop vgc & net stop vgk & taskkill /IM vgtray.exe is included in the command. net stop vgc and net stop vgk tells command prompt to stop the Vanguard services (see above for proof that these are actually Vanguard's services) and taskkill /IM vgtray.exe tells command prompt to close the Vanguard tray icon (otherwise it would stay open even after you stop the services)

Commands for experienced cmders

If you know how to open an elevated command prompt (super easy, barely an inconvenience: search for cmd in the start menu, right click it, run as admin), then you can just run these commands to disable or enable Riot Vanguard (still requires a reboot once you enable it)

# Disable Vanguard (in disable_vanguard.vbs)
sc config vgc start= disabled & sc config vgk start= disabled

# Disable and stop Vanguard (in disable_vanguard_stop.vbs)
sc config vgc start= disabled & sc config vgk start= disabled & net stop vgc & net stop vgk & taskkill /IM vgtray.exe

# Enable Vanguard (in enable_vanguard.vbs)
sc config vgc start= demand & sc config vgk start= system

# Enable Vanguard and restart your computer (in enable_vanguard_restart.vbs)
sc config vgc start= demand & sc config vgk start= system & shutdown /r /f /t 00
' Disables Vanguard from starting when you boot your computer
Call CreateObject("Shell.Application").ShellExecute("cmd.exe", "/c ""sc config vgc start= disabled & sc config vgk start= disabled""", "", "runas")
' Disables Vanguard from starting when you boot your computer and also stops Vanguard
Call CreateObject("Shell.Application").ShellExecute("cmd.exe", "/c ""sc config vgc start= disabled & sc config vgk start= disabled & net stop vgc & net stop vgk & taskkill /IM vgtray.exe""", "", "runas")
' Enables Vanguard so it starts next time you boot your computer
Call CreateObject("Shell.Application").ShellExecute("cmd.exe", "/c ""sc config vgc start= demand & sc config vgk start= system""", "", "runas")
' Enables Vanguard and then reboots your computer to Vanguard
Call CreateObject("Shell.Application").ShellExecute("cmd.exe", "/c ""sc config vgc start= demand & sc config vgk start= system & shutdown /r /f /t 00""", "", "runas")
@Simon-12
Copy link

Hey @AndrewMast, thanks a lot for providing the scripts.

I also took the inspiration and created a command line interface in C++ and a simple user interface to turn Riot Vanguard on and off, as well as adding a shortcut to the startup folder.

Just have a look and check it out, I also linked this site here ;)
github/Simon-12/vanguard-out

Cheers

@s1ryx
Copy link

s1ryx commented Sep 28, 2024

Did anyone find a solution on how to just allow it for the next boot? I would like to explicitly allow the spyware to run for just one boot and then have the script execute once the game exits or the user logs off.

@ragabmigo
Copy link

Good evening guys, please I am looking for someone to implement a script for the Valorant game that plays Automatic Blackout. This is the WhatsApp number to contact: 966506349942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment