Search found 21 matches

by barnabe0057
09 Apr 2023 16:29
Forum: DOS Batch Forum
Topic: Move files with Robocopy
Replies: 1
Views: 2391

Re: Move files with Robocopy

Problem solved !
To force the processing of duplicate files I added the switches /IM /IS /IT
by barnabe0057
09 Apr 2023 15:29
Forum: DOS Batch Forum
Topic: Move files with Robocopy
Replies: 1
Views: 2391

Move files with Robocopy

Hi guys, I'm trying to create a script that sorts files in bulk according to their extension. I use robocopy to move the files. The script is functional, however I encounter a use case where robocopy copies a file but does not delete it from the source. This happens when the tree to be processed con...
by barnabe0057
09 Aug 2021 12:49
Forum: DOS Batch Forum
Topic: How to get the %ERRORLEVEL%
Replies: 3
Views: 3450

Re: How to get the %ERRORLEVEL%

Alles in Ordnung ! Problem solved.
by barnabe0057
09 Aug 2021 12:39
Forum: DOS Batch Forum
Topic: How to get the %ERRORLEVEL%
Replies: 3
Views: 3450

Re: How to get the %ERRORLEVEL%

It's so simple, I blame myself for not having thought about it.
I'll do some testing.

Thank you very much Steffen.
by barnabe0057
09 Aug 2021 11:57
Forum: DOS Batch Forum
Topic: How to get the %ERRORLEVEL%
Replies: 3
Views: 3450

How to get the %ERRORLEVEL%

Hi everybody, I would like to use an external command which is called Wprompt (author: Horst Schaeffer) https://www.horstmuc.de/w32dial.htm#wprompt This command displays a message box with buttons (Ok, Cancel, ...) The Exit Code (Errorlevel) is 1..3 according to the selected button number. On timeou...
by barnabe0057
19 Nov 2020 02:00
Forum: DOS Batch Forum
Topic: About variable expansion
Replies: 8
Views: 8861

Re: About variable expansion

Thank you Eureka! and T3RRY.

Very very very interesting Antonio ! I love your solution
by barnabe0057
18 Nov 2020 08:48
Forum: DOS Batch Forum
Topic: About variable expansion
Replies: 8
Views: 8861

Re: About variable expansion

Thank you jeb.
by barnabe0057
18 Nov 2020 07:56
Forum: DOS Batch Forum
Topic: About variable expansion
Replies: 8
Views: 8861

Re: About variable expansion

Indeed I made a mistake by renaming the variables just before posting. My first idea was to use string-replacement but I didn't get the expected result, the delayed expansion didn't work the way I wanted (=nest 2 delayed variables) Well done for the second FOR I would not have found it myself (8192 ...
by barnabe0057
18 Nov 2020 03:05
Forum: DOS Batch Forum
Topic: About variable expansion
Replies: 8
Views: 8861

About variable expansion

Hi guys, I have a string whose numbers I would like to replace with ***, then each group of asterisks with a single asterisk. The first FOR is working as expected, then I have a problem replacing the *** with a single *, the delayed expansion does not work, you can see it by the ECHO command that I ...
by barnabe0057
09 Nov 2020 17:03
Forum: DOS Batch Forum
Topic: FIND vs FINDSTR
Replies: 4
Views: 4957

Re: FIND vs FINDSTR

a bit complicated but interesting, I just understood the set "%%j" :)
by barnabe0057
09 Nov 2020 16:14
Forum: DOS Batch Forum
Topic: FIND vs FINDSTR
Replies: 4
Views: 4957

Re: FIND vs FINDSTR

I asked the question to satisfy my curiosity, I can continue to use FIND + the temporary file, no problem for me.
Thank you very much for your responsiveness.
by barnabe0057
09 Nov 2020 15:55
Forum: DOS Batch Forum
Topic: FIND vs FINDSTR
Replies: 4
Views: 4957

FIND vs FINDSTR

Hi guys, These 2 lines allow me to detect if a removable disk (a usb key named "USB1") is connected: >"%TEMP%\usb_devices.txt" wmic logicaldisk where drivetype=2 get DeviceID, VolumeName find /i "USB1" "%TEMP%\usb_devices.txt" The FIND command finds the string "USB1" but if I replace FIND with FINDS...
by barnabe0057
08 Nov 2020 13:34
Forum: DOS Batch Forum
Topic: batch file PID
Replies: 6
Views: 9025

Re: batch file PID

My problem is solved thanks to you.
Thank you all for your answers, have a good week.
by barnabe0057
07 Nov 2020 19:23
Forum: DOS Batch Forum
Topic: batch file PID
Replies: 6
Views: 9025

batch file PID

Hi guys,
I would like to know if there is a trick to get a .bat file PID. Apart from "converting" the file to .exe I don't know how to get the matching PID among all the cmd.exe & conhost.exe processes, that would be very useful to me.
Thank you in advance.
by barnabe0057
05 Sep 2017 12:48
Forum: DOS Batch Forum
Topic: renaming a file from A - B.MP3 to B - A.MP3
Replies: 9
Views: 9395

Re: renaming a file from A - B.MP3 to B - A.MP3

Hi, this is another way of proceeding : @echo off setlocal enableextensions cd /d %~1 || exit /B 1 for /f "delims=" %%H in ('dir /b /a-d') do ( set file=%%H call :new_name file ) endlocal exit /B :new_name setlocal enabledelayedexpansion for /F "tokens=1,2,3 delims=-." %%A in ('e...