Search found 1042 matches

by jeb
10 Aug 2010 12:20
Forum: DOS Batch Forum
Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
Replies: 44
Views: 214115

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...
by jeb
10 Aug 2010 11:53
Forum: DOS Batch Forum
Topic: how to remove folder
Replies: 1
Views: 2826

Re: how to remove folder

Hi santhosh,

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.
by jeb
10 Aug 2010 11:47
Forum: DOS Batch Forum
Topic: how to print previous date
Replies: 17
Views: 18643

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'...
by jeb
10 Aug 2010 11:41
Forum: DOS Batch Forum
Topic: Read input file, create seperate files based on table
Replies: 9
Views: 9624

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...
by jeb
10 Aug 2010 03:38
Forum: DOS Batch Forum
Topic: "echo," instead of "echo." or "echo\"
Replies: 12
Views: 15338

"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...
by jeb
08 Aug 2010 14:50
Forum: DOS Batch Forum
Topic: Simple batch Cryptography: howto crypt / decrypt ROT13:
Replies: 32
Views: 42157

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...
by jeb
08 Aug 2010 13:02
Forum: DOS Batch Forum
Topic: Simple batch Cryptography: howto crypt / decrypt ROT13:
Replies: 32
Views: 42157

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...
by jeb
08 Aug 2010 03:29
Forum: DOS Batch Forum
Topic: Simple batch Cryptography: howto crypt / decrypt ROT13:
Replies: 32
Views: 42157

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....
by jeb
06 Aug 2010 13:50
Forum: DOS Batch Forum
Topic: Simple batch Cryptography: howto crypt / decrypt ROT13:
Replies: 32
Views: 42157

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...
by jeb
05 Aug 2010 04:49
Forum: DOS Batch Forum
Topic: Simple batch Cryptography: howto crypt / decrypt ROT13:
Replies: 32
Views: 42157

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?
by jeb
05 Aug 2010 04:29
Forum: DOS Batch Forum
Topic: Remove / and : in strings
Replies: 2
Views: 3385

Re: Remove / and : in strings

Or you can use it like

Code: Select all

set now=%time%
echo %now:~0,2%_%now:~3,2%_%now:~6,2%


Also, you can read about it with set /? :wink:
by jeb
03 Aug 2010 07:19
Forum: DOS Batch Forum
Topic: Extract String and Variable Substitution
Replies: 5
Views: 5757

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.

Code: Select all

set line=abcd00045fghi
set var=1%line:~4,5%
set /a var=2*var - 2%var:~1%
echo var=%var%
by jeb
03 Aug 2010 05:28
Forum: DOS Batch Forum
Topic: Extract String and Variable Substitution
Replies: 5
Views: 5757

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% ...
by jeb
22 Jul 2010 09:07
Forum: DOS Batch Forum
Topic: echo <FF> (to screen or a file)
Replies: 7
Views: 8550

Re: echo <FF> (to screen or a file)

Try it with "Convert decimal to hex, and bytes to chars"
http://www.dostips.com/forum/viewtopic.php?f=3&t=951&p=3305#p3305

jeb
by jeb
09 Jul 2010 15:41
Forum: DOS Batch Forum
Topic: Logging into Windows
Replies: 3
Views: 4903

Re: Logging into Windows

Hi, you could use schtasks (exists on Vista, XP, perhaps also on W2000). Normaly you use it for starting a process (on any computer) at a given time. But if you set the starttime to 1.1.2000 then it will never start, but you can start it directly with /run. So you can write schtasks /create /s clien...