QB64.exe -c %1

by (Login burger2227)
R

 

I made a batch that can be added to the Open With right click BAS menu:



@Echo off
Title QB64 Compiler
color 5F

REM BATCH file MUST be in the QB64 folder!
Set QB64=%~dp0
Echo.QB64 Path: %QB64%

REM Get filename only:
Set FILE=%~nx1
Echo.BAS file: %FILE%

REM Replace BAS with EXE:
SET BASfile=%FILE%
SET EXEfile=%BASfile:.BAS=.EXE%
Echo.EXE file: %EXEfile%
Echo.
REM Get BAS file path:
Set OLDIR=%CD%
Set "OLDPATH=%OLDIR%\%EXEfile%"

REM Change to the QB64 folder path:
CD "%QB64%"

REM Set QB64 folder path:
Set "NEWPATH=%QB64%%EXEfile%"

REM Display Paths:
Echo.QB64 file: %NEWPATH%
Echo.Move file: %OLDPATH%

REM Compile BAS file:
cmd /c start /low QB64.exe -c %1

REM Skip COPY if compiling BAS file in the QB64 folder:
IF "%NEWPATH%" == "%OLDPATH%" GOTO END

ECHO.
ECHO.
ECHO PRESS a Key to MOVE file when Compile has completed!
ECHO.
Pause

ECHO.
MOVE /-Y "%NEWPATH%" "%OLDIR%"
REM COPY "%NEWPATH%" "%OLDPATH%" /-Y
ECHO.
Pause
GOTO END

:END
CLS


Just put it in the QB64 folder and right click a BAS file from anywhere. Afte QB64 compiles, the batch will move the EXE back to the BAS file's folder. It will ask if the EXE already exists there.

Posted on May 5, 2012, 11:38 AM

Respond to this message   

Return to Index

Response TitleAuthor and Date
Thanks on May 5
 Try this: on May 5
  *Thank You on May 6

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement