PDA

View Full Version : Batch with specific parameters?



TylerT
10-07-2014, 10:32 PM
Would it be possible to write a batch file that does the following?


Opens 5+ Simbas from other batch files or shortcuts
Opens them with specific size
Opens them in a specific location on the screen
Opens them each with scripts loaded

I know its possible, just don't know if all of those are possible.

Brandon
10-09-2014, 03:21 AM
Would it be possible to write a batch file that does the following?


Opens 5+ Simbas from other batch files or shortcuts
Opens them with specific size
Opens them in a specific location on the screen
Opens them each with scripts loaded

I know its possible, just don't know if all of those are possible.


1. Possible. Just call "start /C simba.exe -o scriptlocation/scriptname.simba -r"... -r will run it; -o will open it.
2. Not possible. You cannot resize windows with batch files without an external program.
3. Not possible. You cannot move windows with batch files without an external program.
4. See 1.

Alternative.. Run Simba with the batch file method 1.. Have Simba move itself and resize its own window. Not sure if you'd need a plugin for that but that's the best you can get. Otherwise write a program to do it.

TylerT
10-09-2014, 03:35 AM
1. Possible. Just call "start /C simba.exe -o scriptlocation/scriptname.simba -r"... -r will run it; -o will open it.
2. Not possible. You cannot resize windows with batch files without an external program.
3. Not possible. You cannot move windows with batch files without an external program.
4. See 1.

Alternative.. Run Simba with the batch file method 1.. Have Simba move itself and resize its own window. Not sure if you'd need a plugin for that but that's the best you can get. Otherwise write a program to do it.

Perfect! Thanks for the response

m3gaman3g3nd
05-06-2016, 04:37 AM
dont mean to but this is for this thread and its a good add here is something i found that actually might be a possible way to resize a window with batch but even if it is true just only for the console window itself it seems it can work for other applications too
----------


@echo off
setlocal
set mycmdTitle=My Special Command Prompt
Set mycmdHeight=40
Set mycmdWidth=80
Set mycmdBufferHeight=500
Set mycmdBufferWidth=%mycmdWidth%
Set mycmdxPos=0
Set mycmdyPos=120
Set mycmdColor=8f
Set /A mycmdBufferSize=mycmdBufferHeight*0x10000+mycmdBuf ferWidth
Set /A mycmdWindowPos=mycmdyPos*0x10000+mycmdxPos
Set /A mycmdWindowSize=mycmdHeight*0x10000+mycmdWidth
Set mycmdCmd=Title My First Command Prompt^&Echo.^&Echo.^&Echo.^&Echo.
Call :StartCommandPrompt %mycmdBufferSize% %mycmdColor% %mycmdWindowPos% %mycmdWindowSize% "%mycmdTitle%" "%mycmdCMD%"
endlocal
Goto :EOF

:StartCommandPrompt
REM receives %1=BufferSize %2=Color %3=WindowPos %4=WindowSize %5=Title %6=cmd
reg add "HKCU\Console\%~5" /V ScreenBufferSize /T REG_DWORD /D %1 /F >nul
reg add "HKCU\Console\%~5" /V ScreenColors /T REG_DWORD /D 0x%2 /F >nul
reg add "HKCU\Console\%~5" /V WindowPosition /T REG_DWORD /D %3 /F >nul
reg add "HKCU\Console\%~5" /V WindowSize /T REG_DWORD /D %4 /F >nul
start "%~5" %COMSPEC% /K %6
goto :eof

-------------
and heres where i got it from http://stackoverflow.com/questions/11008684/change-the-layout-of-cmd-prompt

m3gaman3g3nd
05-07-2016, 04:19 AM
Ill make this my main Batch thread for now
I have some deleted HTML pages of the JUDAGO.WEBS I can share them
------
call :sub a b c d e f
pause
goto :eof
:sub
echo %*
exit /b
------
^
|
|
|
is there a way to use the %* with out it outputing the arguments with trailing spaces?
heres the output ->
|
|
\/
a b c d e f
-----------
but how to do with %*
abcdef
echo %*:~?? for delims in (%*)echo ??
not sure

wantonman
05-10-2016, 10:04 PM
MODE CON:COLS=40 LINES=12
echo off
goto :0
:sub_0
if not "%s%"=="" if not "%s%"=="]" set /a n=%n%+1
exit /b
:sub_1
if %f% leq 20 (set c=%c%%x%) else (
set _var%e%=%c%
set /a e=%e%+1
set c=%x%
set f=%n%)
exit /b
:sub
set x=
set s=
set n=
set f=
set c=
set e=0
for %%a in (%*) do (
set x=%%a
set n=0
for /l %%b in (0,1,19) do (
call set s=%%x:~%%b,1%%
call :sub_0)
call set /a n=%%n%%+1
call set /a f=%%f%%+%%n%%
call :sub_1)
set _var%e%=%c%
for /l %%d in ( 0 1 %e%) do (
rem call echo %%_var%%d%%)
call set %%_var%%d%%)
exit /b
:mainscreen
cls
echo %var2%
for /l %%d in ( 0 1 %e%) do (
call echo %%_var%%d%%)
echo ....................
echo . .
echo %q%
echo . .
echo ....................
exit /b
:input
call :mainscreen
set /p input=
if %input%==chat call :mainscreen&set /p var2= &call set var=%%var%%%%var2%%&call set var2=%%var%%
if %input%==buyparts set q=. shop .& call :sub [nisan] [honda] [toyota] [mazda] [saab] [alfaromeo] [datsun] [detomaso] [back] [chat]
if %input%==garage set q=. garage .& call :sub [buyparts] [listings] [garage] [back] [chat]
exit/b
:0
set q=. garage .&call :sub [buyparts] [listings] [garage] [back] [chat]
for /l %%a in (0) do (
for /l %%b in (0 1 9) do (
for %%c in (^| \ -- /) do (
for /l %%d in (0 1 8888) do (call)
call :mainscreen
echo %%c))
call :input)