fugu Posted February 10, 2014 Posted February 10, 2014 I've been playing around with the idea of the possibiliity of one ducky script + batch/bash script to rule them all This is a batch/bash part Filename: autorun.bat #!/bin/bash goto :next # ENTER LINUX CODE HERE!!!!!!! echo 'This is the linux part of the script' if [ -n "$(which lsb_release)" ]; then lsb_release -d | sed 's~^Description:\t\(.*\)~\1~g'; fi # EOF LINUX exit 0 :next @echo off REM wine doesnt understand FINDSTR, REM where as windows does echo "YES" | FINDSTR /L "NO" > NUL IF %ERRORLEVEL% EQU 0 goto :wine SET OSVersion=Unknown VER | FINDSTR /L "5.0" > NUL IF %ERRORLEVEL% EQU 0 SET OSVersion=2000 VER | FINDSTR /L "5.1." > NUL IF %ERRORLEVEL% EQU 0 SET OSVersion=XP VER | FINDSTR /L "5.2." > NUL IF %ERRORLEVEL% EQU 0 SET OSVersion=2003 VER | FINDSTR /L "6.0." > NUL IF %ERRORLEVEL% EQU 0 SET OSVersion=Vista VER | FINDSTR /L "6.1." > NUL IF %ERRORLEVEL% EQU 0 SET OSVersion=7 VER | FINDSTR /L "6.2." > NUL IF %ERRORLEVEL% EQU 0 SET OSVersion=8 REM ENTER WINDOWS CODE HERE!!!!!!! echo This is the windows part of the script IF %OSVersion%==Unknown ( ECHO Unable to determine your version of Windows. ) ELSE ( ECHO You appear to be using Windows %OSVersion% ) ECHO. PAUSE REM EOF WINDOWS exit 0 :wine REM ENTER WINE CODE HERE!!!!!!! echo This is the wine part of the script ECHO You appear to be using Wine REM EOF WINE exit 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.