Most likely there are two things. First of all msvcrt80.dll could be missing. Second as the error says no display driver can be found (wine's x11 driver). A lot of apps even if they appear commandline only require a display driver because they require functionality from it while they aren't showing a window themselves. Likely when you were executing the script by hand you had a display variable set, so that winex11.drv could be loaded.