batch script - run command on each file in directory

前端 未结 4 1714
春和景丽
春和景丽 2020-12-05 00:03

I need to convert some xls files into xlsx files. I can successfully convert one xls file into xlsx by running this command into cmd prompt (windows):

ssconv         


        
4条回答
  •  抹茶落季
    2020-12-05 00:45

    Actually this is pretty easy since Windows Vista. Microsoft added the command FORFILES

    in your case

    forfiles /p c:\directory /m *.xls /c "cmd /c ssconvert @file @fname.xlsx"
    

    the only weird thing with this command is that forfiles automatically adds double quotes around @file and @fname. but it should work anyway

提交回复
热议问题