Search found 243 matches

by T3RRY
16 Nov 2020 12:40
Forum: DOS Batch Forum
Topic: ANSI Escape Code does not works with (start) command
Replies: 5
Views: 5058

Re: ANSI Escape Code does not works with (start) command

@echo off chcp 65001> nul for /F %%A in ('echo prompt $E ^| cmd') do set ESC=%%A echo %ESC%[2;2H[2,2] pause> nul ( echo %ESC%[4;4H[4,4] pause> nul ) ( start "" http://example.org echo %ESC%[6;6H[6,6] pause> nul ) Output: [2,2] [4,4] ←[6;6H[6,6] Tested on Microsoft Windows [Version 10.0.18363.592] I...
by T3RRY
12 Nov 2020 08:34
Forum: DOS Batch Forum
Topic: Entering batch argument groups during execution
Replies: 2
Views: 3222

Re: Entering batch argument groups during execution

keeping to a similar style, here is one example of how to achieve this: @Echo off (Set LF=^ %Do Not Modify%) If Not "!![" == "[" Setlocal EnableExtensions EnableDelayedExpansion :CheckArgs If "%~1" == "" ( Choice /N /M "Use Batch Args Y/N?" If !Errorlevel! Equ 1 ( For %%n in (1 2 3)Do Set /P "Arg[%%...
by T3RRY
11 Nov 2020 13:37
Forum: DOS Batch Forum
Topic: Remove gargage characters
Replies: 4
Views: 4100

Re: Remove gargage characters

You are a genius. That worked really great. I wanted to add the command to the output txt file so I could make the output clearer. Do you have any suggestions as to how I can make it look nicer? It really is up to you to choose how to format the output. It would probably be simpler to read a temp o...
by T3RRY
08 Nov 2020 16:29
Forum: DOS Batch Forum
Topic: Batch Games
Replies: 31
Views: 66135

Re: Batch Games

Perhaps you could be interested in my Tetris game in a pure Batch file that uses no additional or auxiliary programs. There is also a version of Tetris in color that uses a PowerShell engine to Read arrow keys and show color text in an efficient way . Antonio Hi Antonio, had already seen your versi...
by T3RRY
08 Nov 2020 07:34
Forum: DOS Batch Forum
Topic: batch file PID
Replies: 6
Views: 6778

Re: batch file PID

The randomised UID isn't strictly necessary, however simplifies isolation of a given instance of the script should multiple instances be running. Ensuring the titles differ is necessary if there is a chance the script may be run in multiple instances at the same time. Unfortunately %RANDOM% is not ...
by T3RRY
08 Nov 2020 03:15
Forum: DOS Batch Forum
Topic: batch file PID
Replies: 6
Views: 6778

Re: batch file PID

It becomes Very easy if you use a title to flag your script. @Echo off Set /A UID=%random% %% 10000 Title %~n0_%UID% 2> nul (For /F "tokens=2 Delims=: " %%G in ( 'Tasklist /Fi "windowtitle eq %~n0_%UID%" /Fi "imagename eq cmd.exe" /FO:List ^| Findstr.exe /LIC:"PID"' )Do Set "%~n0_%UID%=%%G") Set %~n...
by T3RRY
05 Nov 2020 16:25
Forum: DOS Batch Forum
Topic: 2D Array simulation
Replies: 5
Views: 4493

Re: 2D Array simulation

I've done a few such games myself - Connect 4, Conways game of life, Tetris, and my own game, Ampersand Hunters. Typically speaking, a source file is not necessary. Often, the simplest approach is to assign a state value to the Y;X coordinates, then use a pair of nested for /L loop to test the state...
by T3RRY
04 Nov 2020 09:04
Forum: DOS Batch Forum
Topic: 2D Array simulation
Replies: 5
Views: 4493

Re: 2D Array simulation

A very interesting method - unfortunately I found it to be noticeably slower than loading a file into a set of associated variables and accessing the nTh token. May be more efficient for larger files - I haven't tested it to that extent.
by T3RRY
03 Nov 2020 09:20
Forum: DOS Batch Forum
Topic: 2D Array simulation
Replies: 5
Views: 4493

Re: 2D Array simulation

This can be accomplishd fairly easily using some macro's to define arrays and return variables structured in a way that allows reference to line y value x: @Echo off rem /* Increments line count ; assigns line to indexed variable */ Set "Defline=Set /A "Str{i}+=0 + 1"& Set Str[!Str{i}!]=" rem /* ite...
by T3RRY
01 Nov 2020 09:31
Forum: DOS Batch Forum
Topic: Batch Games
Replies: 31
Views: 66135

Re: Batch Games

Decided to try my hand at a pure batch Tetris [ no powershell or external exe's at this point ]. Game uses Vt Escape control character - so unfortunately windows 10 only I was somewhat lazy with the piece rotation routine- I adapted some routines for flipping / mirroring 'images' from one of my prev...
by T3RRY
24 Oct 2020 13:11
Forum: DOS Batch Forum
Topic: Run a vbs script inside Internet Explorer Module
Replies: 2
Views: 3896

Re: Run a vbs script inside Internet Explorer Module

I cant see anyone here helping with a task can be used for malicious purposes.
by T3RRY
24 Oct 2020 07:30
Forum: DOS Batch Forum
Topic: Color Function 21 22 23c
Replies: 40
Views: 55621

Re: Color Function 21 22 23c

"█" How to use this symbol for the color functions? cmd /u color 0b @echo █ It doesnt display... Help? And are there any simple beginners game tutorial in colour like the https://www.youtube.com/watch?v=sJy1sgvKDhU on youtube? I would like to try out. (Im new here, Shara... I hope outside links as ...
by T3RRY
22 Oct 2020 08:56
Forum: DOS Batch Forum
Topic: Batch File to edit specific line of Text file
Replies: 57
Views: 33894

Re: Batch File to edit specific line of Text file

I've been playing around with it again, as using a findstr regular expression as an argument to the GetIn input function makes the length argument and the for loop choice method of input somewhat redundant. The below uses only 2 arguments for the input function: Arg1 - return var name. Arg 2 - Finds...
by T3RRY
21 Oct 2020 10:06
Forum: DOS Batch Forum
Topic: CmdTool Version-1.0 - A portable console IO server
Replies: 2
Views: 3279

Re: CmdTool Version-1.0 - A portable console IO server

Disinclined to test this. As a new user you are an unkown quantity offering download of a zip containing unkown contents / code / virus or malware.

Not to say thats your intent, theres just no reason for anyone to take that risk.
by T3RRY
21 Oct 2020 10:00
Forum: DOS Batch Forum
Topic: Batch File to edit specific line of Text file
Replies: 57
Views: 33894

Re: Batch File to edit specific line of Text file

easiest way is to use findstr to check the entered string is in the sensor serialisation file and use conditional operator || to loop back to retry if not I've modifying the script to pass the character range for the Serial # in the format used by findstr, to display remaining serial numbers that ma...