Search found 55 matches

by lazna
25 May 2024 06:44
Forum: DOS Batch Forum
Topic: custom console window banner
Replies: 5
Views: 6808

Re: custom console window banner

just tried jebs solution. It printing banner fine, but it prepend %a token with strange character this is an autorun script @echo off cls set "_ccl_=%cmdcmdline%" if "%_ccl_:~1,-2%" == "%comspec%" ( echo This is the banner first line echo the second line... ) when start a new console window, it prin...
by lazna
29 Apr 2024 03:05
Forum: DOS Batch Forum
Topic: pipe binary mode
Replies: 1
Views: 754

pipe binary mode

Trying to contruct command which download and unzip set of files in following manner: curl.exe -o- "https://host.com/release/file.zip" | tar.exe -xf - -C "C:\work\target_dir" but some archive files missing in extracted structure. Suspect Windows Defender, but its log display nothing. What could be w...
by lazna
23 Mar 2024 09:35
Forum: DOS Batch Forum
Topic: Cmdwiz - 54 operation cmd helper tool (now with Unicode)
Replies: 58
Views: 120262

Re: Cmdwiz - 54 operation cmd helper tool (now with Unicode)

just discover interesting issue, the cmdwiz 'setbuffersize' behave differently when script is started as a command from existing console window, and when is doubleclicked in windows explorer. But only on _ONE_ of my two machines.... @echo off set rows=27 set cols=90 echo Read current settings c:\uti...
by lazna
16 Mar 2024 02:29
Forum: DOS Batch Forum
Topic: path to hosts file from script
Replies: 3
Views: 1462

Re: path to hosts file from script

Squashman wrote:
15 Mar 2024 12:47
%systemroot% is a variable which means you need double expansion.

Code: Select all

if "%%~a"=="DataBasePath" CALL set "hostspath=%%b"
Thanks Sqashman, you are right, it does work with call.
by lazna
15 Mar 2024 04:31
Forum: DOS Batch Forum
Topic: path to hosts file from script
Replies: 3
Views: 1462

path to hosts file from script

trying to read path of hosts file but it does not work in script @echo off for /f "tokens=1,3" %%a in (' reg query "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /V "DataBasePath" ') do ( if "%%~a"=="DataBasePath" set "hostspath=%%b" ) if exist "%hostspath%\hosts" (echo yes) else (echo no...
by lazna
02 Feb 2024 13:57
Forum: DOS Batch Forum
Topic: SYSTEM account console 254 characters limit
Replies: 4
Views: 9748

Re: SYSTEM account console 254 characters limit

If you think you need the SYSTEM account for something, you're doing something wrong. I do not found any other way to start batch script as a scheduled task to stay COMPLETELLY hidden, than run it under SYSTEM account. If you need more than 254 characters for a single command, you're also doing som...
by lazna
30 Jan 2024 08:37
Forum: DOS Batch Forum
Topic: SYSTEM account console 254 characters limit
Replies: 4
Views: 9748

Re: SYSTEM account console 254 characters limit

psexec is a testing tool only in my case, in reality I need my batch is started as a scheduled task running under SYSTEM account. This failed, so I start testing with psexec and found this issue. My problem arise when trying to start powershell oneliner inside of batch script, which need full path t...
by lazna
21 Jan 2024 11:29
Forum: DOS Batch Forum
Topic: custom console window banner
Replies: 5
Views: 6808

Re: custom console window banner

thank you both, will check your solutions!
by lazna
21 Jan 2024 11:14
Forum: DOS Batch Forum
Topic: SYSTEM account console 254 characters limit
Replies: 4
Views: 9748

SYSTEM account console 254 characters limit

Just found that its imposible to write more than 254 characters to the console window under SYSTEM account. Reproducable step by step - open cmd window as Administrator - perform psexec.exe -s cmd.exe - type whoami, get nt authority\system - start typying characters it stop after 254 chars, command ...
by lazna
24 Dec 2023 05:33
Forum: DOS Batch Forum
Topic: custom console window banner
Replies: 5
Views: 6808

Re: custom console windows banner

UPDATE:

Seems even multiline prompt break scripts too :-/ So it looks this concept is wrong from scratch.

Any other idea?
by lazna
23 Dec 2023 19:19
Forum: DOS Batch Forum
Topic: custom console window banner
Replies: 5
Views: 6808

custom console window banner

If autorun script installed in 'HKLM\SOFTWARE\Microsoft\Command Processor\AutoRun', want to announce it by custom console window simple textual banner. It should appear in the widows header once, just after window is started. As far as text printed by 'echo' command could not be used (because it bre...
by lazna
23 Oct 2023 02:18
Forum: DOS Batch Forum
Topic: printf.exe: Arithmetic and Programming
Replies: 23
Views: 53691

Re: printf.exe: Arithmetic and Programming

I assumed that you downloaded the .zip file and extracted just printf.exe file from it. The .zip file contains 27 files. Why just download printf.exe? Because I am using it in redistributable package which including many other files, and want to minimize files number to keep whole package better ma...
by lazna
22 Oct 2023 13:40
Forum: DOS Batch Forum
Topic: .lnk shortcut - create programatically
Replies: 5
Views: 20404

Re: .lnk shortcut - create programatically

Just discovered the oneliner from first post of this thread display cursor if this one is intentionaly hidden by ANSI sequence, anybody have idea how to avoid this behaviour?
by lazna
22 Oct 2023 13:06
Forum: DOS Batch Forum
Topic: .lnk shortcut - create programatically
Replies: 5
Views: 20404

Re: .lnk shortcut - create programatically

[...] FWIW: MS is telling us that they are about to get rid of VBScript while I've not seen anything about similar intentions for JScript yet. At least I'm not aware of. What do they gain? And why would they make it impossible to run VBS scripts, when BAT scripting has not been ditched long time af...
by lazna
22 Oct 2023 04:45
Forum: DOS Batch Forum
Topic: .lnk shortcut - create programatically
Replies: 5
Views: 20404

Re: .lnk shortcut - create programatically

thanks for explanation