Robocopy has multiple return codes.
https://ss64.com/nt/robocopy-exit.html
Search found 4314 matches
- 08 Apr 2024 10:20
- Forum: DOS Batch Forum
- Topic: Success or failure echo
- Replies: 3
- Views: 326
- 08 Apr 2024 07:32
- Forum: DOS Batch Forum
- Topic: DONT WORK: string input / if construct: output part of string with variable
- Replies: 1
- Views: 194
Re: DONT WORK: string input / if construct: output part of string with variable
Well you have delayed expansion enabled. It would help if you used it.
Code: Select all
if !string:~%counter%,1! EQU 1
- 06 Apr 2024 19:18
- Forum: DOS Batch Forum
- Topic: How to dynamically escape % symbols?
- Replies: 4
- Views: 447
Re: How to dynamically escape % symbols?
Jeb's MagicEcho might help
viewtopic.php?t=6446
viewtopic.php?t=6446
- 04 Apr 2024 08:46
- Forum: DOS Batch Forum
- Topic: how do i get the filesize from a filename? and compare with IF statement
- Replies: 2
- Views: 269
Re: how do i get the filesize from a filename? and compare with IF statement
Surprised your searching did not find any of these links. It is right on the main DosTips.com site library. https://www.dostips.com/?t=Snippets.FileSize As well as discussed in several threads. Here is one of them. https://www.dostips.com/forum/viewtopic.php?t=9274 No clue why you would assign the s...
- 31 Mar 2024 14:48
- Forum: DOS Batch Forum
- Topic: what is the difference between 1> and 2>
- Replies: 4
- Views: 527
- 15 Mar 2024 12:47
- Forum: DOS Batch Forum
- Topic: path to hosts file from script
- Replies: 3
- Views: 773
Re: path to hosts file from script
%systemroot% is a variable which means you need double expansion.
Code: Select all
if "%%~a"=="DataBasePath" CALL set "hostspath=%%b"
- 05 Mar 2024 14:05
- Forum: DOS Batch Forum
- Topic: How to debug this bat file
- Replies: 6
- Views: 2548
Re: How to debug this bat file
Thank you for the reply... If I add ^ infront of the problematic characters (, ), | What would the line look like? I'm not familiar with that character. Isn't that line a remark? Why would the cmd interpreter care what characters are in a remark? Thank you, Are you saying you are not familiar with ...
- 29 Feb 2024 16:50
- Forum: DOS Batch Forum
- Topic: How to put path with blanks into "for" command? Masking & quotes
- Replies: 9
- Views: 6013
Re: How to put path with blanks into "for" command? Masking & quotes
We have a discussion about it here on DosTips. I will see if I can dig up that thread.mataha wrote: ↑29 Feb 2024 16:24Escaping the quotes shouldn't be necessary:
Code: Select all
for /f delims^= %%g in ('""D:\some\path\with blanks inside\myprog.exe" -p "......" %1"') do set "....."
- 28 Feb 2024 17:47
- Forum: DOS Batch Forum
- Topic: How to read a txt file to sort out the string then output to a folder with some txt files
- Replies: 9
- Views: 2191
Re: How to read a txt file to sort out the string then output to a folder with some txt files
OK I see now. I just had another issue when the fist line string has one space at the end. the folder will become 5 digits Schemes_to_Sign_for_829501 the folder will be 29501. Anyway to cut off the space before set it as folder? I bet if you use the sites search capability you will find all kinds o...
- 28 Feb 2024 13:34
- Forum: DOS Batch Forum
- Topic: How to compare 2 modified file timestamps?
- Replies: 6
- Views: 1902
Re: How to compare 2 modified file timestamps?
I should have known we answered this question before.
Compare timestamps of two files (seconds too)
Compare timestamps of two files (seconds too)
- 28 Feb 2024 13:21
- Forum: DOS Batch Forum
- Topic: How to put path with blanks into "for" command? Masking & quotes
- Replies: 9
- Views: 6013
Re: How to put path with blanks into "for" command? Masking & quotes
An extra set of escaped double quotes would have done the trick.
Code: Select all
for /F "Tokens=*" %%G in (' ^""D:\some\path\with blanks inside\myprog.exe" -p "......" %1^"') do set "....."
- 28 Feb 2024 13:12
- Forum: DOS Batch Forum
- Topic: How to compare 2 modified file timestamps?
- Replies: 6
- Views: 1902
Re: How to compare 2 modified file timestamps?
This will not get seconds. Only has minute precision.
Code: Select all
for %%G in ("aaaa.dat") do for /f "tokens=1-5 delims=/: " %%H IN ("%%~tG") do set "aaaats=%%J%%H%%I%%K%%L"
- 27 Feb 2024 13:44
- Forum: DOS Batch Forum
- Topic: How to read a txt file to sort out the string then output to a folder with some txt files
- Replies: 9
- Views: 2191
Re: How to read a txt file to sort out the string then output to a folder with some txt files
Thanks a lot! Antonio! Yes works perfefectly! Just a quick question for this line for /F "delims=\" %%a in ('findstr "_ ." source.txt') do ( So what is this 'findstr "_ ."? the rest I can understand.... Thanks again! Will You could help yourself by reading the help for the FINDSTR command. Use spac...
- 26 Feb 2024 11:06
- Forum: DOS Batch Forum
- Topic: How to read a txt file to sort out the string then output to a folder with some txt files
- Replies: 9
- Views: 2191
Re: How to read a txt file to sort out the string then output to a txt file
It will create a folder name as 852046 under this folder there will be some files, in this cases, will be three files, one is T503-08667-0108.txt, T503-08667-0109.txt, and T503-08939-0102.txt This is contradictory. You are asking to create a folder but then you go on to say that several files alrea...
- 26 Feb 2024 11:03
- Forum: DOS Batch Forum
- Topic: How to read a txt file to sort out the string then output to a folder with some txt files
- Replies: 9
- Views: 2191
Re: How to read a txt file to sort out the string then output to a txt file
Why haven't you attempted to do this task yourself?
You have certainly been given enough code examples over the past 7 years to accomplish this task.
You have certainly been given enough code examples over the past 7 years to accomplish this task.