Search found 1966 matches

by penpen
17 Jun 2021 09:28
Forum: DOS Batch Forum
Topic: Batch script to rename text files to match image files names.
Replies: 5
Views: 4071

Re: Batch script to rename text files to match image files names.

I am so sorry for making the above error and want to apologize.
I hope the /Y command wasn't preset in the COPYCMD variable,
so your test environment wasn't messed up.
Thanks to Squashman, for finding that error, i literally didn't see that.
I fixed the above code.
by penpen
15 Jun 2021 02:05
Forum: DOS Batch Forum
Topic: Batch script to rename text files to match image files names.
Replies: 5
Views: 4071

Re: Batch script to rename text files to match image files names.

This might help you (untested):

Code: Select all

@echo off
setlocal enableExtensions disableDelayedExpansion
pushd "Z:\Images\Converted\"
for %%a in (*.jpg *.psd) do copy "Placehold.txt" "%%~na.txt"
popd
goto :eof
penpen

Edit: Corrected critical error, thanks to Squashman for seeing that.
by penpen
10 Jun 2021 17:44
Forum: DOS Batch Forum
Topic: Get cursor position
Replies: 5
Views: 4454

Re: Get cursor position

Thanks to jeb, the cursor position could be read using the vt100 functionality with pure batch: https://www.dostips.com/forum/viewtopic.php?f=3&t=9454&p=61318#p61322 Sidenote: You could do the same using C# to compile an executable file, which is done in the first post... but then you better might w...
by penpen
01 Jun 2021 18:36
Forum: DOS Batch Forum
Topic: Check output of called Script
Replies: 3
Views: 3058

Re: Check output of called Script

I'm not sure i fully understand you: Except for exceptions that are able to completely abort batch file execution and the start-command used with specific arguments, that might open a new window, which might not be closed, nearly whatever programming logic you use in "Master_Batch.bat" shouldnt affe...
by penpen
30 May 2021 19:12
Forum: DOS Batch Forum
Topic: Unexpected DOS shell expansion of %~n1 and %~x1
Replies: 4
Views: 4469

Re: Unexpected DOS shell expansion of %~n1 and %~x1

The expansion of wildcards within batch- and for-variable-expansion and is normal and i'm also pretty sure it was discussed here somewhere, but at the moment i can't find it. However, if i remember right, then the reason why your specific solution works is because the doublecolon character is an Alt...
by penpen
29 May 2021 08:48
Forum: DOS Batch Forum
Topic: Need help
Replies: 24
Views: 12084

Re: Need help

Based on the first few files of the game i opened in notepad, i guess every file that contains an "echo" (no matter the case) might be a good candidate; assumed that the game main directory is located in "Z:", the following batch might help you to list them all: @echo off setlocal enableExtensions d...
by penpen
29 May 2021 06:09
Forum: DOS Batch Forum
Topic: Unexpected DOS shell expansion of %~n1 and %~x1
Replies: 4
Views: 4469

Re: Unexpected DOS shell expansion of %~n1 and %~x1

Wildcard expansion rules can be found here:
viewtopic.php?f=3&t=6207#p39420.

The "*.*" case doesn't go haywire at all - the first match in your cases is the actual directory (".").


penpen
by penpen
27 May 2021 19:49
Forum: DOS Batch Forum
Topic: Check output of called Script
Replies: 3
Views: 3058

Re: Check output of called Script

At the moment you don't call another batch file. You just tell the command line processor to execute a different batch file (with new parameters) instead of the actual one. It's like changing the disc in your DVD-Player - there can be only one. Previously processed batch files and progress in them a...
by penpen
04 May 2021 06:11
Forum: DOS Batch Forum
Topic: How to make a game saving system?
Replies: 3
Views: 3039

Re: How to make a game saving system?

There are multiple ways to do that, just use the search function to look them all up. You might for example use the following save/load functions (untested): @echo off setlocal enableExtensions disableDelayedExpansion call :init call :debug call :save set "value1=D" set "value2=E" set "value3=F" cal...
by penpen
03 Apr 2021 02:29
Forum: DOS Batch Forum
Topic: tv
Replies: 9
Views: 24122

Re: tv

You might use ECMA-Script (JScript) to deal with JSON; see: - https://www.dostips.com/forum/viewtopic.php?f=3&t=9049#p59302 - https://www.dostips.com/forum/viewtopic.php?f=3&t=9049#p59297 - https://www.dostips.com/forum/viewtopic.php?f=3&t=9049#p59303 - https://www.dostips.com/forum/viewtopic.php?f=...
by penpen
02 Apr 2021 10:29
Forum: DOS Batch Forum
Topic: ms:settingswindowsupdate hidden
Replies: 7
Views: 5938

Re: ms:settingswindowsupdate hidden

Yes, as i wrote the "windows update page window simply ignores such options", like running minimized or hidden. So there is not much you can do about that from pure batch. Therefore you have to use a programming language such as C++, with which you first start the windows update window, then hook in...
by penpen
30 Mar 2021 19:34
Forum: DOS Batch Forum
Topic: Batch treat special characters as input errors
Replies: 8
Views: 5884

Re: Batch treat special characters as input errors

I would like all non-numeric characters to be considered as input error. Alphabetic characters are well considered but not certain special characters like colons and others ones such as !, ", %, ^, &, ), =, |, <, and > I don't understand what you want: In the first sentence you wrote that alphabeti...
by penpen
28 Mar 2021 08:24
Forum: DOS Batch Forum
Topic: ms:settingswindowsupdate hidden
Replies: 7
Views: 5938

Re: ms:settingswindowsupdate hidden

I thought of something like the following: "C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe" "-Command" "$wshShell = New-Object -ComObject WScript.Shell; $result = $WshShell.Run(\"ms-settings:windowsupdate\", 2);" Sidenote: I always test with the option "2" (=Activates the window and displ...
by penpen
26 Mar 2021 06:30
Forum: DOS Batch Forum
Topic: Command prompt - combining files by name
Replies: 13
Views: 9553

Re: Command prompt - combining files by name

Well, i only can say what Microsoft has published within their documentation and have no additional insights into their exact code of (course). Therefore i can't say how you reliably cause a non alphabetical order under NTFS 3.0+. Maybe to distort the order, you could use some files with short names...