This is an example using a hybrid file.bat + script.r
@;echo off && setlocal
@;
@;pushd "C:\Program Files\R\R-4.0.5\bin\i386\." 2>nul && (
@;
@; %__APPDIR__%findstr.exe /vb @; ^<"%~f0" >"%temp%\RScr.r"
@; R.exe --vanilla <"%tmp%\RScr.r">nul 2>&1 ) || (
@;
@; echo\Error: script.r not found^!! )
@;
@;2>nul del/q "%tmp%\RScr.r" & endlocal & goto :eof
@;
@;rem :: below you can insert your R codes without start lines with "@;"
require(tcltk)
msgBox <- tkmessageBox(title = "tc/ltk SO Q431647",
message = "Hello, world! by tcltk!", icon = "info", type = "ok")
msgBox <- tkmessageBox(title = "zOk Click..",
message = "z0k", type = "ok")
Try:
cd /d "C:\Program Files\R\R-3.6.1\bin\i386" && Rscript.exe ScriptCode.R
https://i.stack.imgur.com/SRRnc.gif[
^]
bat - Gerar uma janela de pop-up no R - Stack Overflow em Português[
^]