ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Command-Line Shooter

<< < (2/2)

4wd:

--- Code: Text ---for /f "tokens=* delims=" %x in (test.txt) do start "" cmd.exe /C %x
FYI

KodeZwerg:
Due missing part "file.txt content example" I just coded an application that is capable to execute or open files.

Shooter v0.1 by KodeZwerg

Manual

shooter is a window console application, driven by parameters only.
possible parameters are /file="Filename" /begin=X /end=Y /loop=Z


parameter description
/file=
fill that parameter with a quoted "path\filename.ext" value.
my application does not need to be in same folder of "path\filename.ext".
"Filename" must be a plaintext textfile,
where every line lead to a qualified "path\filename.ext" file.
(missing quotes inside textfile are auto-generated)

/begin=
tell my program at which line it should begin
default is line #1

/end=
tell my program at which line it should end
if using /loop, this parameter has no effect
default is end of file

/loop=
tell my program how many times it should loop



Examples:
shooter.exe /file=test.txt [return]
that would call my app to try execute every line inside test.txt

shooter.exe /file=test.txt /begin=2 [return]
that would call my app to try execute every line, beginning with line 2 inside test.txt

shooter.exe /file=test.txt /end=2 [return]
that would call my app to try execute every line inside test.txt until line 2 is reached

shooter.exe /file=test.txt /loop=2 [return]
that would call my app to try execute every line inside test.txt until line 2 is reached

shooter.exe /file=test.txt /begin=2 /end=6 [return]
that would call my app to try execute lines 2-6 inside test.txt

shooter.exe /file=test.txt /begin=2 /loop=4 [return]
that would call my app to try execute lines 2-6 inside test.txt


i hope that is enough explaination.
enjoy another KodeZwerg production.


if anything goes wrong, my app will inform you with "Error: " message inside console.
it will not stop if an error occured during execution phase.

//edit
for your information, this app does not use command.com interpreter, it invoke ShellExecuteEx() from Windows Api to do it's job.

KodeZwerg:
Then you must hope that everything you wish to execute this way is correctly formatted. If not, it messes up the ability of shooter.exe to finish completing the set of (single line) command.
-Shades (September 16, 2020, 11:26 AM)
--- End quote ---
my app simple say "Error: unable to find x y z" or something like that.


If there are 300+ single line batch commands to execute...there has to be some logic behind them. Because if not, it will become a mess. Maybe not today, but in the near future it will.
-Shades (September 16, 2020, 11:26 AM)
--- End quote ---
i'd thought about to include a /wait=X parameter, to wait X ms between next call.
aslong ShellExecuteEx() is okay to be used, i also could integrate a /WaitUntilExecutionEnds switch.

While KodeZwerg might like to create AHKodeZwerg
-Shades (September 16, 2020, 11:26 AM)
--- End quote ---
i love your fantasy "AHK....odeZwerg"  :Thmbsup:
but in fact i do have no clue about script languages. i try to avoid them ;)

Navigation

[0] Message Index

[*] Previous page

Go to full version