Search found 1059 matches
- 12 Aug 2010 12:17
- Forum: DOS Batch Forum
- Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
- Replies: 44
- Views: 289546
Re: ECHO. FAILS to give text or blank line - Instead use ECH
Ok, i tested it again, and this are my results These one fails always (command can not be found) echo{ echo} echo) echo^ echo! echo' echo` echo~ EDIT: I fixed some incorrect description, see also Discussion about jeb's batch parsing rules on StackOverflow These one fails, if files exists like echo*....
- 11 Aug 2010 17:00
- Forum: DOS Batch Forum
- Topic: How can I search for quotes in a for loop with findstr?
- Replies: 5
- Views: 6694
Re: How can I search for quotes in a for loop with findstr?
Why this works? Well, I don't know it exactly. Seems that normal variables will expand before the line is processed by cmd.exe Yes, the expansion of ! is nearly the latest interpreter phase for a line. I have made some experiments ... The phasese are: Expanding of %var% Parse the first two tokens o...
- 10 Aug 2010 12:20
- Forum: DOS Batch Forum
- Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
- Replies: 44
- Views: 289546
Re: ECHO. FAILS to give text or blank line - Instead use ECH
I suggest that if a character is acceptable to Windows as being part of a file name, then that character cannot be safely used as a "suffix" to ECHO, otherwise CMD.EXE will trawl through the current directory and then the %PATH% trying to find "ECHO+" with an executable extensio...
- 10 Aug 2010 11:53
- Forum: DOS Batch Forum
- Topic: how to remove folder
- Replies: 1
- Views: 3303
Re: how to remove folder
Hi santhosh,
if you know the content it should be easy
But it will fail if your date has a format like "10/08/2010", the "/" is not allowed as (directory-)name.
if you know the content it should be easy
Code: Select all
mkdir sat_%date%
... do some stuff here
rmdir sat_%date%
But it will fail if your date has a format like "10/08/2010", the "/" is not allowed as (directory-)name.
- 10 Aug 2010 11:47
- Forum: DOS Batch Forum
- Topic: how to print previous date
- Replies: 17
- Views: 24414
Re: how to print previous date
It only works on an english version, because you get something like "current date is 10/08/2010" "Enter new date: (DD-MM-YY)" or it also works with "Enter new date: (YY-DD-MM)" but in german you got "Geben Sie das neue Datum ein: (TT-MM-JJ)" So the script can'...
- 10 Aug 2010 11:41
- Forum: DOS Batch Forum
- Topic: Read input file, create seperate files based on table
- Replies: 9
- Views: 11168
Re: Read input file, create seperate files based on table
The first is when I write the data ECHO %name% >> "ADDRESS.%newCode1%.%newCode2%" it's add a blank space at the end of line It's because of the space behind %name% You can use ECHO %name%>> "ADDRESS.%newCode1%.%newCode2%" or >> "ADDRESS.%newCode1%.%newCode2%" ECHO %nam...
- 10 Aug 2010 03:38
- Forum: DOS Batch Forum
- Topic: "echo," instead of "echo." or "echo\"
- Replies: 12
- Views: 18991
"echo," instead of "echo." or "echo\"
Hi, the problem: If you want to echo a variable that could be empty you can not use echo %var% because the output is not empty, instead you got "echo is enabled (on)" or something similar. So most people use the echo. trick echo.%var% This works, but fails if you have anywhere in your path...
- 08 Aug 2010 14:50
- Forum: DOS Batch Forum
- Topic: Simple batch Cryptography: howto crypt / decrypt ROT13:
- Replies: 32
- Views: 53411
Re: Simple batch Cryptography: howto crypt / decrypt ROT13:
As you can see I escaped the brackets too, but no success. Any ideas? Yes. It is the ampersand, it is active because the escape for second quote isn't working. (I suppose it is not neccessary to escape the brackets) So the command is splitting set "newstring=^" & (" set "new...
- 08 Aug 2010 13:02
- Forum: DOS Batch Forum
- Topic: Simple batch Cryptography: howto crypt / decrypt ROT13:
- Replies: 32
- Views: 53411
Re: Simple batch Cryptography: howto crypt / decrypt ROT13:
" Zeichen ist kein Problem Ok, at this point it isn't a problem, but next time ... Will do my best. Do you have any suggestions, jeb? That's why the problem is tricky, I believe there is no simple, clean solution. Example string 12>345^6"78^9a>b Because, the first replacement have to be t...
- 08 Aug 2010 03:29
- Forum: DOS Batch Forum
- Topic: Simple batch Cryptography: howto crypt / decrypt ROT13:
- Replies: 32
- Views: 53411
Re: Simple batch Cryptography: howto crypt / decrypt ROT13:
Seems I got it. Sorry, but you didn't Your example is too short This one fails. example.txt UEME_RUNPATH:C:\Program Files\myProggy\ &()[]{}^=;!'+,`~-_><|*?%$/.@"#0123 "&()[]{}^=;!'+,`~-_><|*?%$/.@"#0123 ")" kann syntaktisch an dieser Stelle nicht verarbeitet werden....
- 06 Aug 2010 13:50
- Forum: DOS Batch Forum
- Topic: Simple batch Cryptography: howto crypt / decrypt ROT13:
- Replies: 32
- Views: 53411
Re: Simple batch Cryptography: howto crypt / decrypt ROT13:
call set S_%%a=%%n%% REM what does here exactly happen or set "char=%char:^=^^%" REM same as above... The first line is a simple set of the variables named S_a, S_B, S_c,... with the values 0, 1, 2, ... It is the same like set S_a=0 set S_b=1 set S_c=2 The second line is a replacement fun...
- 05 Aug 2010 04:49
- Forum: DOS Batch Forum
- Topic: Simple batch Cryptography: howto crypt / decrypt ROT13:
- Replies: 32
- Views: 53411
Re: Simple batch Cryptography: howto crypt / decrypt ROT13:
ByteAnalyser wrote:---::[ NoteS ]::---
Just again some comments or info about "very special" functions or characters used...
Are you interested in "very special" functions or do you have a question about one of your functions?
- 05 Aug 2010 04:29
- Forum: DOS Batch Forum
- Topic: Remove / and : in strings
- Replies: 2
- Views: 4014
Re: Remove / and : in strings
Or you can use it like
Also, you can read about it with set /?
Code: Select all
set now=%time%
echo %now:~0,2%_%now:~3,2%_%now:~6,2%
Also, you can read about it with set /?

- 03 Aug 2010 07:19
- Forum: DOS Batch Forum
- Topic: Extract String and Variable Substitution
- Replies: 5
- Views: 6991
Re: Extract String and Variable Substitution
You got problems, because numbers with prefixed "0" are interpreted as octal numbers
A simple way is to prepend a "1" to the number and then remove it mathematical.
A simple way is to prepend a "1" to the number and then remove it mathematical.
Code: Select all
set line=abcd00045fghi
set var=1%line:~4,5%
set /a var=2*var - 2%var:~1%
echo var=%var%
- 03 Aug 2010 05:28
- Forum: DOS Batch Forum
- Topic: Extract String and Variable Substitution
- Replies: 5
- Views: 6991
Re: Extract String and Variable Substitution
It is a litte bit tricky. @echo off setlocal EnableDelayedExpansion set line=abcde1234fghil set Rec1=5 set Rec2=4 call set var1=%%line:~%Rec1%,%Rec2%%% echo var1=%var1% set var2=!line:~%Rec1%,%Rec2%! echo var2=%var2% Variant1 works because after the first expansion you got call set var1=%line:~5,4% ...