I have a .bat file, in the file I did:
to-csv.vb
program on the files I'm stuck at step 6. Here is my code:
cd "Python\test1"
copy "Python\test1\"*.xls* "Python\test1\move"
FOR /f "delims=" %%i IN ('DIR *.xls* /b') DO to-csv.vbs "%%i" "%%i.csv"
del "H2*.csv"
del "H6*.csv"
del "H3*.xlsx"
cd "H:\UCLAHealth\HIIN\Data Process\Python" #my python script1 is in this directory
python script1.py #this line didn't work.
I'm ok with steps 1-5, but stuck on step 6. What's the correct syntax for running a Python script in .bat file?
You can either do this in your script:
set "python=C:\path to Python\python.exe"
"%python%" script1.py
Or you can execute it with full path:
"C:\Path to Python\python.exe" script1.py
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.