I have found this code which works on Linux:
#!/bin/bash
fileid="FILEIDENTIFIER"
filename="FILENAME"
curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${fileid}" > /dev/null
curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${fileid}" -o ${filename}
Source: wget/curl large file from google drive
The problem is the awk needs to be replaced for Windows implementation.
The way I found to do it is like instead of:
command | awk '{ print $4 }'
do something like:
for /f "tokens=4" %%a in ('command') do echo %%a
My problem is I'm not familiar with awk and the NF variable. So I don't really know how to convert $NF on batch implementation to do the exact same thing.
I found the solution. FINDSTR did the trick. So now it perfectly works with:
for /f "tokens=7" %%a in ('findstr "download" cookie.txt') do echo %%a