Search found 996 matches

by ShadowThief
23 Jan 2021 14:18
Forum: DOS Batch Forum
Topic: SORT supports the /UNIQUE option!
Replies: 5
Views: 75

Re: SORT supports the /UNIQUE option!

I could have sworn that we already had a thread about this and I learned about it from that. Naturally, I can't check because search is currently broken. :roll:

It got added with Windows 10 (https://stackoverflow.com/a/50314929/4158862), but it seems that Microsoft forgot to document it.
by ShadowThief
21 Jan 2021 16:03
Forum: DOS Batch Forum
Topic: JSON file in wrong format.
Replies: 3
Views: 116

Re: JSON file in wrong format.

The web viewer is manipulating the data to make the JSON more readable. Curl just grabs the data as it is currently stored. If you want to prettify it, you'll have to do that yourself.
by ShadowThief
17 Jan 2021 17:36
Forum: DOS Batch Forum
Topic: Is there a way to make a bootable batch file?
Replies: 5
Views: 314

Re: Is there a way to make a bootable batch file?

rasil wrote:
11 Jan 2021 10:03
I am just doing this as a challenge to see if I can build a os!
You certainly can, just not by using a language that requires an existing operating system to function. Real operating systems are written in C and assembly. https://wiki.osdev.org/Getting_Started
by ShadowThief
12 Jan 2021 17:17
Forum: DOS Batch Forum
Topic: Need help running imagemagick command over many files
Replies: 9
Views: 378

Re: Need help running imagemagick command over many files

The fact that it's "looping forever" suggests to me that you've called your script convert.bat, which would mean that when you run the line convert "%~1" -resize 300 "%~1.jpg" , you're telling the script to run itself instead of running imagemagick's convert command. Either give the full path to con...
by ShadowThief
24 Nov 2020 08:02
Forum: DOS Batch Forum
Topic: ansi.bat: handling ANSI sequences in nowadays WIN terminals
Replies: 8
Views: 1294

Re: ansi.bat: handling ANSI sequences in nowadays WIN terminals

siberia-man wrote:
24 Nov 2020 07:00
Independently on this feature is turned on or off, both type and echo support ANSI:
I was going to ask how I've been able to use ANSI this whole time without touching the registry, but that explains it; I've only been using them with echo.
by ShadowThief
12 Nov 2020 13:58
Forum: DOS Batch Forum
Topic: DEL *this* file (whatever its name) in Batch File
Replies: 4
Views: 1121

Re: DEL *this* file (whatever its name) in Batch File

Horrifyingly, I've spent almost the last decade tab-completing the name of the script so I've literally never run into this problem. :shock:
by ShadowThief
12 Nov 2020 08:32
Forum: DOS Batch Forum
Topic: DEL *this* file (whatever its name) in Batch File
Replies: 4
Views: 1121

Re: DEL *this* file (whatever its name) in Batch File

%0 is the full path of the script that is currently running.

Code: Select all

del %0
by ShadowThief
12 Nov 2020 08:30
Forum: DOS Batch Forum
Topic: Debugging / syntax checksing tools for batch
Replies: 27
Views: 6616

Re: Debugging / syntax checksing tools for batch

I wrote a script to echo a number after each line in your script. Is that the last executed line number echoed? Can you post an example of such script here for a basic test batch sample. @echo off setlocal enabledelayedexpansion set "show_usage=echo USAGE: %~nx0 ^<input_file^> & exit /b" if "%~1"==...
by ShadowThief
08 Nov 2020 16:45
Forum: DOS Batch Forum
Topic: Batch Games
Replies: 31
Views: 37627

Re: Batch Games

Once upon a time, I took a bunch of games written in BASIC and ported them to batch: https://github.com/sintrode/batch_minigames

Treasure.bat is there because there was a topic on there about code for calculating square roots that I wanted to try out.
by ShadowThief
03 Nov 2020 22:54
Forum: DOS Batch Forum
Topic: Some holiday animations (from Vt100.net)
Replies: 6
Views: 1415

Re: Some holiday animations (from Vt100.net)

IcarusLives wrote:
03 Nov 2020 22:33
I have a question for @penpen!

Why add 0 to this? :)

Code: Select all

set /a "delay=1000-%~2+0"
I was inspecting your code, but I am curious if I am missing something here?
I'm guessing it's to prevent syntax errors if %2 isn't provided
by ShadowThief
28 Oct 2020 16:34
Forum: DOS Batch Forum
Topic: A killer : in a comment
Replies: 15
Views: 2043

Re: A killer : in a comment

:: is only a comment if it's at the very beginning of the line, otherwise it's a syntax error I also see two lines where you don't use a & between the line and the comment, which is also causing issues. Labels inside of loops have always been precarious at best. Personally, I either switch to REM fo...
by ShadowThief
15 Oct 2020 21:08
Forum: DOS Batch Forum
Topic: Vt escape codes and cursor hide / show
Replies: 10
Views: 1809

Re: Vt escape codes and cursor hide / show

Everything that's listed here will work: https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences yet to figure out how to get cursor position using the ESC[6n Query myself. The closest I've been able to get so far is echo [5;2H[6n set /p cpos= echo Cursor at %cpos:~2,-1%...
by ShadowThief
25 Sep 2020 20:04
Forum: DOS Batch Forum
Topic: How to use a POST request in batch with curl.exe?
Replies: 8
Views: 1913

Re: How to use a POST request in batch with curl.exe?

There are two methods listed there: -d and -F. I know for a fact that -F works because I use it on a regular basis to upload to imgur. Give me example of -F command. I'm using the command below and the http server doesn't show any access attempt. curl -d "name=test&phone=00000000" http://127.0.0.1/...
by ShadowThief
23 Sep 2020 07:36
Forum: DOS Batch Forum
Topic: How to use a POST request in batch with curl.exe?
Replies: 8
Views: 1913

Re: How to use a POST request in batch with curl.exe?

There are two methods listed there: -d and -F. I know for a fact that -F works because I use it on a regular basis to upload to imgur.

It's hard to troubleshoot your issue if you don't give us more details, like where you're trying to send the command or what the exact commands that you tried were.