Search found 53 matches

by lazna
23 Mar 2024 09:35
Forum: DOS Batch Forum
Topic: Cmdwiz - 54 operation cmd helper tool (now with Unicode)
Replies: 58
Views: 115512

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: 724

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: 724

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: 9168

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: 9168

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: 4
Views: 6045

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: 9168

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: 4
Views: 6045

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: 4
Views: 6045

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: 22
Views: 52020

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: 19867

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: 19867

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: 19867

Re: .lnk shortcut - create programatically

thanks for explanation
by lazna
22 Oct 2023 04:30
Forum: DOS Batch Forum
Topic: printf.exe: Arithmetic and Programming
Replies: 22
Views: 52020

Re: printf.exe: Arithmetic and Programming

Just download zip file, extract printf.exe and run it:

:\Users\user>\utils\printf.exe
printf.exe Version 1.0 Copyright (C) 2016-2020, Antonio Perez Ayala

'printfHelp.bat' is not recognized as an internal or external command,
operable program or batch file.
by lazna
21 Oct 2023 04:52
Forum: DOS Batch Forum
Topic: .lnk shortcut - create programatically
Replies: 5
Views: 19867

.lnk shortcut - create programatically

As far as VBS is marked as obsolete (and will be removed from next windows version), looking for alternative way of shortcut creation from batch file other than VBS script. Found powershell oneliner powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$shortcut = New-Object -ComObject WScript...