Search found 240 matches

by pieh-ejdsch
04 Jul 2024 13:15
Forum: DOS Batch Forum
Topic: ENABLEDELAYEDEXPANSION in called bat files
Replies: 2
Views: 13510

Re: ENABLEDELAYEDEXPANSION in called bat files

Hello Miskos; You are trying to include exclamation marks in a variable while Delayed Expansion is enabled. You are trying to display a variable containing exclamation marks in percent signs during Delayed Expansion. You are aware of the fact that the inclusion of variables with exclamation marks ei...
by pieh-ejdsch
25 Nov 2023 11:45
Forum: DOS Batch Forum
Topic: cmd.exe forensic?
Replies: 1
Views: 18507

Re: cmd.exe forensic?

Hi rodrigo.brasil, Cmd.exe is an extended version of command.com. A command line interpreter. A *.bat is evaluated by command.com. Cmd.exe evaluates *.bat and *.cmd. Cmd.exe opened as a command line loads an instance into memory. If a process is started in the command line, cmd.exe starts a subordin...
by pieh-ejdsch
15 Nov 2023 06:25
Forum: DOS Batch Forum
Topic: Sequential file backup
Replies: 5
Views: 20780

Re: Sequential file backup

You can drag one or more folders or files onto the batch.
This corresponds to the full path as a parameter.
by pieh-ejdsch
03 Nov 2023 11:58
Forum: DOS Batch Forum
Topic: Sequential file backup
Replies: 5
Views: 20780

Re: Sequential file backup

Hallo drgt,
What you are looking for is a small versioning of different states of one and the same file or files or folders.

You can find the appropriate script here:

viewtopic.php?t=7903#p52948

Just read the description

Phil
by pieh-ejdsch
05 Mar 2023 08:34
Forum: DOS Batch Forum
Topic: Robocopy issue
Replies: 3
Views: 9032

Re: Robocopy issue

As it looks in your case, everything can be the same in 7 backups. You can use the error level of Robocopy to know if something was copied or not. Depending on the result, you can then delete the oldest or the previously created folder. You can also check the old backup(s) for timestamps from seven ...
by pieh-ejdsch
07 Feb 2021 06:13
Forum: DOS Batch Forum
Topic: Problem with variable Drive setup for XP/W98SE
Replies: 18
Views: 26457

Re: Problem with variable Drive setup for XP/W98SE

Hi,
I think its so (untestet)

Code: Select all

echo exit |command /k prompt set drive=$N |find "set" >Tempdrv.bat
echo.>>Tempdrv.bat
Call Tempdrv
Echo %drive%
Phil
by pieh-ejdsch
03 Jan 2021 10:33
Forum: DOS Batch Forum
Topic: .bat does not always pass parameter correctly at EOF (end-of-file)
Replies: 2
Views: 4484

Re: .bat does not always pass parameter correctly at EOF (end-of-file)

It's actually related to the redirect. If the redirect sneaks into the command out of place, then the first token after the redirection is missing a whitespace character. If there are more than two tokens behind the redirection, the command line is executed in full. It is best to put the redirect at...
by pieh-ejdsch
01 Jan 2021 06:38
Forum: DOS Batch Forum
Topic: Equivalent 9XDos code to NT Find bat/cmd path %~dp0
Replies: 12
Views: 13731

Re: Equivalent 9XDos code to NT Find bat/cmd path %~dp0

If you change to another directory, a possible drive change must also be made afterwards. I created an equivalent for Pushd and Popd in the win98 timestamp bat to create these variables (yy mm and so on). https://administrator.de/forum/win98-batch-datum-ermitteln-variable-splitten-tag-mon-jahr-22131...
by pieh-ejdsch
18 Oct 2020 05:19
Forum: DOS Batch Forum
Topic: Proper way of getting function arguments with spaces and specials characters...
Replies: 3
Views: 5700

Re: Proper way of getting function arguments with spaces and specials characters...

maybe you can try it. :argsNtoTokens @echo off for /f "delims==" %%a in ('2^>nul set param_') do set "%%a=" if ! lss ' (setlocal disabledelayedexpansion) else setlocal @set prompt=$g$s :::::::::::::::::::: setting :::::::::::::::::::::::::::::::::: rem use comma or space as delimiter: set argsN=2,3,...
by pieh-ejdsch
13 Sep 2020 15:39
Forum: DOS Batch Forum
Topic: A problem with symlink script
Replies: 6
Views: 7501

Re: A problem with symlink script

Hi absolutelyrandom1234, Is always problematic if the delayed variables are taken in the For-loop - but work is still delayed in "do". All that comes out is gibberish. Mixing the delayed- with forvariables can be done if there are no special characters to be expected. Always work with a delay in "in...
by pieh-ejdsch
06 Sep 2020 11:25
Forum: DOS Batch Forum
Topic: FOR doesn't iterate properly
Replies: 4
Views: 5788

Re: FOR doesn't iterate properly

You can display the for variable so that it only expands to the filename.

Code: Select all

for %%G IN (*.pdf) DO Echo %%~nG
by pieh-ejdsch
12 Aug 2020 09:43
Forum: DOS Batch Forum
Topic: Letter used in a variable.
Replies: 15
Views: 15172

Re: Letter used in a variable.

The errorlevel of chice is output exactly after the index of the characters. The extension of variables is done according to the offset. Why do you change the index to letter? Oh, you still need in the script. But if NOT 1 if - then it is also sufficient: set drives= abcde choice /c %drives% /n /m "...
by pieh-ejdsch
14 Jul 2020 10:53
Forum: DOS Batch Forum
Topic: Why doesn't this replacement work?
Replies: 3
Views: 5278

Re: Why doesn't this replacement work?

Hallo, That's how you actually write one-liners! You should simply write the list as it is with each other in the for- loop, then you will have it a little clearer. A second for-loop for the name of the log file completes the matter. IF DEFINED X for /f "tokens=2delims==" %%K in ("FDMEE_KOF=_KICKOUT...
by pieh-ejdsch
21 Jun 2020 12:21
Forum: DOS Batch Forum
Topic: Repetitively read x lines from txt file and pass to called program
Replies: 1
Views: 3775

Re: Repetitively read x lines from txt file and pass to called program

Hallo Bryan, Your example has only 34 lines ... I would not read the lines, but always read the first block line. Look for the 4-digit number and create the file with this number. Then transfer to the processing program. The last file is treated at the end - or the first line of the original file is...
by pieh-ejdsch
14 Jun 2020 05:07
Forum: DOS Batch Forum
Topic: Recursively Delete File Types From A Named Folder Only
Replies: 2
Views: 4743

Re: Recursively Delete File Types From A Named Folder Only

you can use a for /r loop in a recursive search

Code: Select all

( for /d /r %%a in (Target-Folder.?) do @ DEL /S /Q "%%a\*.psr" "%%a\*.zip" ) >Deleted-psr-zip.txt 2>&1
Phil