Search found 70 matches

by shodan
22 May 2024 03:00
Forum: DOS Batch Forum
Topic: Fast and robust :GetSubstringIndex :ReplaceString :CreateRandomStringPS functions !
Replies: 4
Views: 601

Re: Fast and robust :GetSubstringIndex :ReplaceString :CreateRandomStringPS functions !

Just did a better :split Still has bugs but that one should be a lot faster on long input strings It should respect CASESENSITIVE Limit does nothing still breaks on byval percentsigns, byval pipe byref pipe byval exclamationmark still fails to split on byval ampersand byref single carret, byref ampe...
by shodan
22 May 2024 01:22
Forum: DOS Batch Forum
Topic: Fast and robust :GetSubstringIndex :ReplaceString :CreateRandomStringPS functions !
Replies: 4
Views: 601

Re: Fast and robust :GetSubstringIndex :ReplaceString :CreateRandomStringPS functions !

I am working on a split function It currently works, here is the output GetSubstringIndex-DEMO.bat delimiter :,: input string :THIS,IS,A,TEST: comment : classic comma separated, works 0:THIS 1:IS 2:A 3:TEST delimiter :.: input string :THIS.IS.A.TEST: comment : using dots instead, works 0:THIS 1:IS 2...
by shodan
20 May 2024 01:46
Forum: DOS Batch Forum
Topic: Console live toggle Quick Edit with these one-liner functions :QuickEditOFF :QuickEditON :PrintQuickEdit
Replies: 0
Views: 61

Console live toggle Quick Edit with these one-liner functions :QuickEditOFF :QuickEditON :PrintQuickEdit

Quick and self-explanatory :QuickEditOFF powershell -command "Add-Type -TypeDefinition 'using System;using System.Runtime.InteropServices;public class QEOFF{[DllImport(\"kernel32.dll\")]private static extern IntPtr GetStdHandle(int nStdHandle);[DllImport(\"kernel32.dll\")]private static extern bool ...
by shodan
17 May 2024 19:07
Forum: DOS Batch Forum
Topic: Difficulty running powershell in a for loop due to unquoting and closing of parenthesis
Replies: 3
Views: 322

Re: Difficulty running powershell in a for loop due to unquoting and closing of parenthesis

That's a bingo Thank you @penpen Active ----- True InstanceName ----- DISPLAY\DELD092\4&dead9271&0&UID21beef_0 ManufacturerName ----- 68 69 76 0 0 0 0 0 0 0 0 0 0 0 0 0 ProductCodeID ----- 68 48 57 50 0 0 0 0 0 0 0 0 0 0 0 0 SerialNumberID ----- 57 80 DE AD BE EF 52 80 DE AD BE EF 0 0 0 0 UserFriend...
by shodan
17 May 2024 02:41
Forum: DOS Batch Forum
Topic: Difficulty running powershell in a for loop due to unquoting and closing of parenthesis
Replies: 3
Views: 322

Difficulty running powershell in a for loop due to unquoting and closing of parenthesis

I need to run the following commands in a for loop to capture their output powershell -command "Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorID | ForEach-Object { $_.PSObject.Properties | ForEach-Object { if ($_.Name -ne 'CimInstanceProperties') { \"$($_.Name)=$($_.Value)\" }}}" powershe...
by shodan
14 May 2024 22:07
Forum: DOS Batch Forum
Topic: Dinosaur Game from Chrome in Batch - Remake
Replies: 4
Views: 382

Re: Dinosaur Game from Chrome in Batch - Remake

Probably yes, I'm not an expert on the topic of console graphics. I did use the win32 api to draw on the console window but I'm not sure that counts when passing a window over it makes the image disappear. I am curious about sixel which appears to be a standard of some kind from the long ago https:/...
by shodan
13 May 2024 19:28
Forum: DOS Batch Forum
Topic: Dinosaur Game from Chrome in Batch - Remake
Replies: 4
Views: 382

Re: Dinosaur Game from Chrome in Batch - Remake

In pure batch too, I am impressed

I wonder if we will ever manage native batch Sixel support (without needing a terminal with builtin sixel support of windows 11)

https://askubuntu.com/questions/97542/h ... l-pictures

(see viu and icat)
by shodan
13 May 2024 19:20
Forum: DOS Batch Forum
Topic: pushd popd depend on batch filenames with which they run... why?
Replies: 13
Views: 992

Re: pushd popd depend on batch filenames with which they run... why?

Just for fun, I have asked chatgpt about this here is chatgpt classic https://chat.openai.com/share/1591e9b7-3a03-479e-8d32-83e6f5d2f968 here is chatgpt 4o, today's newest model https://chat.openai.com/share/ee8e7ba3-c929-4e65-8cbb-0f6bef333484 The best it got, is to use %CD% if you pushd a file wit...
by shodan
13 May 2024 18:54
Forum: DOS Batch Forum
Topic: Functions to find "base" function and their aliases ( :GetBaseFunction :IsBaseFunction :IsFunctionAlias ... )
Replies: 2
Views: 151

Re: Functions to find "base" function and their aliases ( :GetBaseFunction :IsBaseFunction :IsFunctionAlias ... )

Here are a few more of the support functions within I will revisit these when I present about the bfw batchfileframework officially :ShiftedArgumentCaller set _ShiftedArgumentCaller_function=%~1 shift set "_ShiftedArgumentCaller_function=" & GoTo :%_ShiftedArgumentCaller_function% GoTo :EOF :PrintWi...
by shodan
13 May 2024 18:49
Forum: DOS Batch Forum
Topic: Functions to find "base" function and their aliases ( :GetBaseFunction :IsBaseFunction :IsFunctionAlias ... )
Replies: 2
Views: 151

Re: Functions to find "base" function and their aliases ( :GetBaseFunction :IsBaseFunction :IsFunctionAlias ... )

Here are the functions themselves ::Usage Call :GetBasefunction BatchFile FunctionName ReturnVariable ::returns row number of BaseFunction :GetBaseFunctionRow :GetBaseFunctionName :GetBaseFunction set "_GetBaseFunction_prefix=_GBF" set "_GBF_BatchFile=%~1" set "_GBF_FunctionName=%~2" set "_GBF_Outpu...
by shodan
13 May 2024 18:37
Forum: DOS Batch Forum
Topic: Functions to find "base" function and their aliases ( :GetBaseFunction :IsBaseFunction :IsFunctionAlias ... )
Replies: 2
Views: 151

Functions to find "base" function and their aliases ( :GetBaseFunction :IsBaseFunction :IsFunctionAlias ... )

Hi, functions.zip I made simple to use helper function, to determine if a function is a "base" function or an alias. Also to obtain a list of alias related to a specific base function. First, what is a function :Hello echo Hello,world GoTo :EOF Also, I have what I call the preamble and the post-scri...
by shodan
30 Apr 2024 03:22
Forum: DOS Batch Forum
Topic: Fast and robust :GetSubstringIndex :ReplaceString :CreateRandomStringPS functions !
Replies: 4
Views: 601

Re: Fast and robust :GetSubstringIndex :ReplaceString :CreateRandomStringPS functions !

Improved version of the functions This now works with strings at least 8100 characters long Mostly works with everything that doesn't contain poison characters New extensive test setup is very effective at finding any remaining bugs ! See function GetSubstringIndex-demo at the bottom and ready to us...
by shodan
30 Apr 2024 03:00
Forum: DOS Batch Forum
Topic: pushd popd depend on batch filenames with which they run... why?
Replies: 13
Views: 992

Re: pushd popd depend on batch filenames with which they run... why?

Tried adding filename to the tests The code AAA BBB.bat @ECHO OFF echo this is AAA BBB.bat echo 1 %~dp0 PUSHD %~dp0 echo 2 %~dp0 cd .. echo 3 %~dp0 popd echo 4 %~dp0 echo this is AAA BBB.bat part2 echo 1 %~dpn0 PUSHD %~dp0 echo 2 %~dpn0 cd .. echo 3 %~dpn0 popd echo 4 %~dpn0 AAABBB.bat @ECHO OFF ech...
by shodan
30 Apr 2024 02:51
Forum: DOS Batch Forum
Topic: pushd popd depend on batch filenames with which they run... why?
Replies: 13
Views: 992

Re: pushd popd depend on batch filenames with which they run... why?

Hi, Just tried a simpler version Code for AAABBB.bat @ECHO OFF CLS echo this is AAABBB.bat echo 1 %~dp0 PUSHD %~dp0 echo 2 %~dp0 cd .. echo 3 %~dp0 popd echo 3 %~dp0 Code for AAA BBB.bat @ECHO OFF CLS echo this is AAA BBB.bat echo 1 %~dp0 PUSHD %~dp0 echo 2 %~dp0 cd .. echo 3 %~dp0 popd echo 3 %~dp0...
by shodan
29 Apr 2024 17:31
Forum: DOS Batch Forum
Topic: Fast and robust :GetSubstringIndex :ReplaceString :CreateRandomStringPS functions !
Replies: 4
Views: 601

Re: Fast and robust :GetSubstringIndex :ReplaceString :CreateRandomStringPS functions !

New version of Works to 8155 characters with byref input string, now supports byref parameters for either or both or none input and replace string Still breaks on poison characters Call :CreateRandomStringPS PUNCTUATION NOPOISON SPACE EXTENDED 8155 testvar ::Usage Call :ReplaceString InputString Rep...