Search found 231 matches

by pieh-ejdsch
13 Sep 2020 15:39
Forum: DOS Batch Forum
Topic: A problem with symlink script
Replies: 6
Views: 317

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

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

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

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

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

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
by pieh-ejdsch
03 Jun 2020 09:01
Forum: DOS Batch Forum
Topic: How to add 'del ' as leading sttring of all lines of a file ?
Replies: 2
Views: 909

Re: How to add 'del ' as leading sttring of all lines of a file ?

vorticity wrote:
02 Jun 2020 12:10
My problem: writing file1.jpg file2.jpg ... into a file for the ftp_delete_script is easy...
You write this into this - how?
Manually...
Is a list with this files there?

Phil
by pieh-ejdsch
01 Jun 2020 10:29
Forum: DOS Batch Forum
Topic: Copy files do not overwrite existing
Replies: 11
Views: 15382

Re: Copy files do not overwrite existing

First you create a list of the files to be excluded. Only those that are in the source and the destination are listed. So the command backwards xcopy /LUY target source Just a bit with showing the source files. You add this to your correct command as an exclusion list. @echo off setlocal set prompt=...
by pieh-ejdsch
23 May 2020 13:23
Forum: DOS Batch Forum
Topic: Self Updating Continuously Running Batch
Replies: 7
Views: 1590

Re: Self Updating Continuously Running Batch

This batch does not use a label and can be changed easily, so it is the changeable second part. Only a copy is made in a subfolder, which then runs and runs ... @ rem Don't change this part @echo off setlocal rem Endless update part. This part controls the copying/updating of the batch. rem The batc...
by pieh-ejdsch
17 Apr 2020 11:59
Forum: DOS Batch Forum
Topic: How to make a scanner that scans a batch file?
Replies: 3
Views: 1914

Re: How to make a scanner that scans a batch file?

A simple first checkCMD.cmd that was started, which was created to find corresponding commands, variables, brackets, parameters etc. in batch files, is here. The output contains the numbers and the line found. This script can be easily expanded and new parameters and corresponding search terms can b...
by pieh-ejdsch
12 Apr 2020 16:32
Forum: DOS Batch Forum
Topic: Can't parse arguments to variable
Replies: 5
Views: 2235

Re: Can't parse arguments to variable

The comparison with your IF line does not work out as you would expect. If you want to know what goes wrong then you have to evaluate the displayed errors. For successful troubleshooting, it has proven useful to switch on the echo and thus to find something in the last displayed lines that leads to ...
by pieh-ejdsch
11 Apr 2020 09:11
Forum: DOS Batch Forum
Topic: Runaway problem with FINDSTR "Line {nnn} is too long"
Replies: 1
Views: 1546

Re: Runaway problem with FINDSTR "Line {nnn} is too long"

This is definitely the 2 GB limit. Since nothing can be written into the files with certainty, each file must be considered for itself. A line must be searched for without a line end, and at the same time the error message must be evaluated. You can even calculate how long this line is, for example....
by pieh-ejdsch
09 Mar 2020 07:11
Forum: DOS Batch Forum
Topic: batch file to move all files from one folder to another
Replies: 3
Views: 2457

Re: batch file to move all files from one folder to another

Hello Bob,
please search for MoveintTree

Phil
by pieh-ejdsch
10 Feb 2020 05:43
Forum: DOS Batch Forum
Topic: Subtract files from a folder
Replies: 1
Views: 3653

Re: Subtract files from a folder

What is diff?
Which specific (different) content have these files?
Test this
viewtopic.php?p=60645#p60645
or You can try doublettes finder?