Run Python Script on Selected File

前端 未结 4 1102
星月不相逢
星月不相逢 2020-12-07 17:57

I would like to write a python script that would upload any file I select in Windows Explorer. The idea is to select any file in Windows Explorer, right-click to display fil

4条回答
  •  庸人自扰
    2020-12-07 18:39

    Instead of %1 use %*.

    %1 will pass in the first argument, %* will pass all (%n will pass in the nth...)

    @echo off
    cls
    python C:\Your\File\uploadscript.py %*
    

    Note that the command line has built in character limits 2047 for XP and prior, 8191 for windows 7 and later

提交回复
热议问题