This topic was published by and viewed 3366 times since "". The last page revision was "".

Viewing 1 post (of 1 total)
  • Author

  • DevynCJohnson
    • Topics - 437
    • @devyncjohnson

    Windows batch files can be run on Linux like shell scripts. First the user must have Wine installed. Then, download the file below. After extracting the file, move it to /usr/bin/ or /usr/share/bin/. Be sure that the file is named "winescript" and is executable.

    Below is an example. Use Root privileges when executing the below commands.

    mv ./winescript /usr/share/bin/winescript
    chmod +x /usr/share/bin/winescript

    In the batch file on the Linux system, place "#!/usr/bin/env winescript" in the file as the first line. Then, make the batch file executable (chmod +x ./batchfile.bat).

    Now, the batch file can be executed as if it were running on a Windows system.

    Winescript is made by Devyn Collier Johnson and is Public Domain (CC0)

    Download version 2015.02.08

    Example batch file

    #!/usr/bin/env winescript
    @ECHO off
    ECHO Hello World!

    Winescript Source Code

    # -*- coding: utf-8 -*-
    # vim:fileencoding=utf-8
    # Created by Devyn Collier Johnson
    # <[email protected]>
    # Version 2015.02.08
    # Public Domain (CC0)
    FILE=/tmp/script_$(date "+%s%N").bat
    tail -n +2 $1 > $FILE
    wine cmd.exe /c $FILE
    rm $FILE
    echo ""

Viewing 1 post (of 1 total)