批处理文件执行python 文件并生成运行日志log.txt, log 乱码问题

批处理文件
1.执行python 文件process-log-Compare.py ,并且生成log 日志。log 生成以后乱码,把Bat 文件存储类型从utf-8改成ANSI 也不行,执行完反而是空的

由于安装的是anaconda 底下要怎么改呢?加了pause 还是闪退,不知道哪里有问题 。
call 后面那句 active.bat 后面还要再加一遍C:\User\202912\Anaconda3_64 ?直接写anaconda3还是Anaconda3_64? 什么都没写也是可以执行的,没懂active.bat 后面跟的一句起什么作用

call C:\Users\Anaconda3_64\Scripts\active.bat C:\User\202912\Anaconda3_64
cd C:\Users\Downloads\Process-Log-Compare\ProcessLogComp
python Process-Log-Compare.py > log.txt
echo on
set t=%t%%time:~0,2%%time:~3,2%
set "Ymd=%date:~,4%%date:~5,2%%date:~8,2%"
set folder=%ymd%_%t% 
cd C:\Users\202912\Downloads\ESDX\Wuxi\01oldData
md %folder% 
cd C:\Users\202912\Downloads\ESDX\Wuxi\01oldData\%folder%
set backup=C:\Users\202912\Downloads\ESDX\Wuxi\01oldData\%folder%
md rawData
set rawData=C:\Users\202912\Downloads\ESDX\Wuxi\01oldData\%folder%\rawData

move "C:\Users\202912\Downloads\ESDX\Wuxi\Process-Log-Compare\01Trace\*.csv"  %backup% 
move "C:\Users\202912\Downloads\ESDX\Wuxi\Process-Log-Compare\02Config\fileGroup.csv"  %backup% 
move "C:\Users\202912\Downloads\ESDX\Wuxi\Process-Log-Compare\02Config\ParameterStepTag.csv"  %backup%
move "C:\Users\202912\Downloads\ESDX\Wuxi\Process-Log-Compare\02Config\ParameterTag.csv"  %backup%
move "C:\Users\202912\Downloads\ESDX\Wuxi\Process-Log-Compare\03MergeData\*.csv"  %backup%
move "C:\Users\202912\Downloads\ESDX\Wuxi\Process-Log-Compare\04Comparison\*.csv"  %backup%
move "C:\Users\202912\Downloads\ESDX\Wuxi\Process-Log-Compare\05Result\*.csv"  %backup%
move "C:\Users\202912\Downloads\ESDX\Wuxi\Process-Log-Compare\06Summary\*.csv"  %backup%
move "C:\Users\202912\Downloads\ESDX\Wuxi\Process-Log-Compare\06Summary\merge\*.csv"  %backup%
move "C:\Users\202912\Downloads\ESDX\Wuxi\Process-Log-Compare\07Visual\*.csv"  %backup%
Pause
call C:\Users\202912\Anaconda3_64\Scripts\activate.bat
cd C:\Users\202912\Downloads\ESDX\Wuxi\Process-Log-Compare\ProcessLogComp
python Process_Log_Compare.py > log.txt

pause

image.png

阅读 2.1k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏