Search found 243 matches

by T3RRY
13 Jan 2022 19:33
Forum: DOS Batch Forum
Topic: Use Checklist to Run Selected Commands.
Replies: 7
Views: 4546

Re: Use Checklist to Run Selected Commands.

each of those command menus in the script you've posted above currently flow through to the following command To achieve the type of script flow you describe, each comand set needs to be used as a function via call and terminated using Exit /b or goto:eof The all you need to do is build a list of fu...
by T3RRY
22 Dec 2021 08:17
Forum: DOS Batch Forum
Topic: Change desktop wallpaper
Replies: 17
Views: 13828

Re: Change desktop wallpaper

First of all, thanks for replying. Your code is perfect and works as expected I have been slow to respond because I have tried to understand your code to adapt it to mine, but I am very far from being able to do it because of the little knowledge I have. I wonder: If the directory (path) of the ima...
by T3RRY
21 Dec 2021 00:10
Forum: DOS Batch Forum
Topic: Change desktop wallpaper
Replies: 17
Views: 13828

Re: Change desktop wallpaper

This can be done without needing to reboot via a batch / powershell hybrid. The below is what I use personally. Note: the menu system I use in it requires windows 10 version 10586 or newer to output correctly <# : batch portion :# The above line marks the beginning of a powershell comment block; and...
by T3RRY
19 Dec 2021 03:03
Forum: DOS Batch Forum
Topic: toggle case
Replies: 2
Views: 2854

Re: toggle case

AR Coding wrote:
18 Dec 2021 22:38
Hi,
doesnt Dostips already have such a function?
www.dostips.com/DtCodeCmdLib.php#Function.toLower
www.dostips.com/DtCodeCmdLib.php#Function.toUpper
This utility appears different in the sense only target characters will have case toggled, as opposed to converting the case of an entire string.
by T3RRY
26 Nov 2021 08:35
Forum: DOS Batch Forum
Topic: Coding challenge for any interested parties
Replies: 20
Views: 10061

Re: Coding challenge for any interested parties

You should also check against code injection inputs like 'test=123" & echo(' with a big enough length like 10. I only found one reliable way to check whether the input string is empty. I'm not sure if i should post it here as it may spoil the fun out of it for others to discover that for themselves...
by T3RRY
25 Nov 2021 10:50
Forum: DOS Batch Forum
Topic: Coding challenge for any interested parties
Replies: 20
Views: 10061

Re: Coding challenge for any interested parties

Classic off-by-one errors. Also, I totally missed that the first two lines in your sample input were where you were getting user input. Updated: https://github.com/sintrode/stringwalker I've edited the example and added an second example to avoid any further confusion There remains one final error ...
by T3RRY
25 Nov 2021 10:42
Forum: DOS Batch Forum
Topic: Coding challenge for any interested parties
Replies: 20
Views: 10061

Re: Coding challenge for any interested parties

@Lowsun Your approach is succesful,Unfortunately however, error output is occuring for strings containing Doublequotes: C:\Users\tcdou>lowsun2 Enter string : !@#$%^&* :"": = end Enter number : 20 1:"!" 2:"@" 3:"#" 4:"$" 5:"%" 6:"^" 7:"&" 8:"*" 9:" " 10:":" The system cannot find the batch label spec...
by T3RRY
24 Nov 2021 21:24
Forum: DOS Batch Forum
Topic: Coding challenge for any interested parties
Replies: 20
Views: 10061

Re: Coding challenge for any interested parties

Classic off-by-one errors. Also, I totally missed that the first two lines in your sample input were where you were getting user input. Updated: https://github.com/sintrode/stringwalker I've edited the example and added an second example to avoid any further confusion There remains one final error ...
by T3RRY
24 Nov 2021 21:14
Forum: DOS Batch Forum
Topic: Coding challenge for any interested parties
Replies: 20
Views: 10061

Re: Coding challenge for any interested parties

I think, you need to provide some more detail on the input Edit: You also might want to limit to win10 cmd.exe only, because some solutions might not work on XP. Thanks for your suggestions. I have edited the opening post to provide some more clarity about forms of input, the environment that will ...
by T3RRY
24 Nov 2021 08:47
Forum: DOS Batch Forum
Topic: Coding challenge for any interested parties
Replies: 20
Views: 10061

Re: Coding challenge for any interested parties

How can there be no character at an index if the string continues past that index? If you pass the sample input you provided to my script, it matches your output exactly. > Take 2 Inputs of the following types: - A string containing any combination of printable ASCII characters that may be of any l...
by T3RRY
24 Nov 2021 08:35
Forum: DOS Batch Forum
Topic: Coding challenge for any interested parties
Replies: 20
Views: 10061

Re: Coding challenge for any interested parties

Glad to see a number of people taking on the challenge - Seeing as the cats out the bag and multiple solutions have already been posted, I wont hold back till the weeks up with mine: The original version: Rem original golfed version: Rem https://pastebin.com/gp86e5mK Rem Pastebin Pass: split @Set x=...
by T3RRY
24 Nov 2021 08:29
Forum: DOS Batch Forum
Topic: Coding challenge for any interested parties
Replies: 20
Views: 10061

Re: Coding challenge for any interested parties

I just thought of an interesting solution, but it doesn't fit the requirements (no number literals) and I don't think it's possible without them, so I'll just post it here. @ECHO OFF SET /P "str=Enter string : " SET /P "max=Enter number : " SET "num=1" ( FINDSTR "^;" "%~f0" ECHO :%max% ECHO PAUSE E...
by T3RRY
24 Nov 2021 08:23
Forum: DOS Batch Forum
Topic: Coding challenge for any interested parties
Replies: 20
Views: 10061

Re: Coding challenge for any interested parties

Not sure if I'll find the time to work on that any further. Proof of concept: @echo off &setlocal set "s=This (!@#$%^&*() String" set "n=15" call set "s=%%s:~,%n%%%" cmd /u /c ^"<nul set /p "=%s%"^"|find /v ""|findstr /n "^" pause Steffen Beautiful solution, the only shortcoming is that it doesn't ...
by T3RRY
24 Nov 2021 08:21
Forum: DOS Batch Forum
Topic: Coding challenge for any interested parties
Replies: 20
Views: 10061

Re: Coding challenge for any interested parties

The hardest part was doing this without an if statement. https://github.com/sintrode/stringwalker Vey close, A couple of easily resolved Issues exist though: - Display of the expanded string on line 26 (Which is not required) Results in a syntax error with redirection characters or pipes. - Script ...
by T3RRY
23 Nov 2021 09:35
Forum: DOS Batch Forum
Topic: Coding challenge for any interested parties
Replies: 20
Views: 10061

Coding challenge for any interested parties

*Following PenPen's suggestions, some edits have been made to provide clarity * Background: I enjoy batch scripting and a bit of code golfing in my spare time, and generally enjoy activities that require a degree of problem solving. I find batch to be interesting simply because there's a multitude ...