Cannot pass an argument from ".bat" file to python script

  argv, batch-file, python-3.x, windows

I am trying to run a python script from my .bat file but I cannot pass the arguments. Please find my code below:

.bat File

set fileDestination = "homea.."
set fileLocation = "homeb.."
set fileName = "myFile.xlsx"

"C:SwdtoolsPython3.6.3 X64Python" fileTransfer.py %fileDestination% %fileLocation% %fileName%

fileTransfer.py

import sys

print(sys.argv[2]) 

The above print statement gives me

IndexError: list index out of range

Source: Windows Questions

LEAVE A COMMENT