Search found 146 matches

by trebor68
21 Mar 2015 05:15
Forum: DOS Batch Forum
Topic: Is there an explanation for the result of SET/P and CLIP?
Replies: 7
Views: 9332

Is there an explanation for the result of SET/P and CLIP?

I have come to an unexpected result when testing with my batch file. This result can also be generated at the prompt. >echo. | set /p ".=a15(51|62)" a15(51|62) >echo. | set /p ".=a15(51|62)" | clip > The first command displays the result correctly. The second command copies the r...
by trebor68
08 Jan 2015 20:07
Forum: DOS Batch Forum
Topic: Testing if it is a file or folder?
Replies: 6
Views: 5788

Re: Testing if it is a file or folder?

Please see more informations: CALL /? Here a small batch file: @echo off setlocal :: echo %1 %~a1 set test=%~a1 set test=%test:~0,1% if %test%==d (echo %1 is a directory) else echo %1 is not a directory Tested in Win7. Here some examples: D:\CMDVerz>exattr InRegEx5.bat InRegEx5.bat is not a director...
by trebor68
02 Sep 2014 14:47
Forum: DOS Batch Forum
Topic: Dos Batch Math Library
Replies: 69
Views: 101456

Re: Dos Batch Math Library

Here a batch file to calculate the Square root. The steps correspond to the calculation with decimal numbers, but here the calculations on binary numbers are optimized. BATCH value BATCH value IEEE value "Value" is an integer from 0 through 2147483647. The result is calculated to four deci...
by trebor68
19 Aug 2014 08:18
Forum: DOS Batch Forum
Topic: Dos Batch Math Library
Replies: 69
Views: 101456

Re: Dos Batch Math Library

@dbenham Thank you. The code has previously worked well up to this point. But after the code change I have probably not tested again this part. Change the condition for the perfect squares greater 100. Also change condition for the not perfect squares (now checked with variable zahl2). The result wi...
by trebor68
19 Aug 2014 02:01
Forum: DOS Batch Forum
Topic: Dos Batch Math Library
Replies: 69
Views: 101456

Re: Dos Batch Math Library

I have changed the code. Now the pure square numbers less than 100 are also correct. The result has now less one decimal place, but this is rounded. @echo off SetLocal EnableDelayedExpansion echo Square Root set para=%1 if %1# equ # (echo ERROR no number or negativ number) & echo. & goto :eo...
by trebor68
17 Aug 2014 15:45
Forum: DOS Batch Forum
Topic: Dos Batch Math Library
Replies: 69
Views: 101456

Re: Dos Batch Math Library

Calculating Square Root Here the mathematic rules: (a + b)^2 = a^2 + 2ab + b^2 = a^2 + (2a + b) * b (a + b + c)^2 = a^2 + 2ab + b^2 + 2ac + 2bc + c^2 = a^2 + (2a + b) * b + (2a + 2b + c) * c Here my code @echo off echo Square Root set para=%1 if %1# equ # (echo ERROR no number or negativ number) &am...
by trebor68
30 Jun 2014 03:18
Forum: DOS Batch Forum
Topic: How to findstr strings that are German?
Replies: 10
Views: 10401

Re: How to findstr strings that are German?

This code creates a batch file that shows the differences with the German letters between CP1252 and CP850. Hint: Microsoft Windows OS versions newer than XP contain certutil.exe. Older OS versions may be able to install certutil.exe as part of another package, e.g. the Windows 2003 Server Service P...
by trebor68
24 Jun 2014 04:48
Forum: DOS Batch Forum
Topic: How to findstr strings that are German?
Replies: 10
Views: 10401

Re: How to findstr strings that are German?

The following code need a parameter (name of city) to check this in in file. Don't use quotes in the parameter. BATCH Saarbrücken BATCH Frankfurt (Main) @echo off setlocal EnableExtensions REM in Windows found the German characters in CP1252 and CP1250 at the same position REM check: input Alt+0165 ...
by trebor68
17 Dec 2013 17:37
Forum: DOS Batch Forum
Topic: I got a boot-able ms-dos 6.22 iso, but there's no setup !
Replies: 6
Views: 8577

Re: I got a boot-able ms-dos 6.22 iso, but there's no setup

This files are not the complete MS-DOS 6.22 system.

If you have install the system at the hard drive before, then use this files (boot CD) when your old MS-DOS system will not boot.

This is not nothing for the newest computer with hard drive capacity with more than 2 GB (2.000 MB).
by trebor68
26 Nov 2013 10:09
Forum: DOS Batch Forum
Topic: Enhance the batch file
Replies: 2
Views: 3116

Re: Enhance the batch file

Your code need to change the row to: ... findstr /v "^Total" < "%name%" >"X:\FOLDER\%dd%%mm%%yyyy:~2%Q.txt" ... The letter X: is the USB drive (USB pen) and FOLDER is the path at this drive. The letter of the USB drive is not anytime the same letter. Possible is this pr...
by trebor68
23 Nov 2013 18:04
Forum: DOS Batch Forum
Topic: Calculator
Replies: 12
Views: 8382

Re: Calculator

In this forum was a thread and there also a link to a calculator:

thread: http://www.dostips.com/forum/viewtopic.php?f=3&t=4279

link: http://judago.webs.com/batchfiles.htm
See there: STR_MATH.BAT
by trebor68
20 Nov 2013 14:44
Forum: DOS Batch Forum
Topic: [Undocumented] Rmdir (but not useful)
Replies: 1
Views: 2330

Re: [Undocumented] Rmdir (but not useful)

In Win XP parameter /-S or /-Q are not possible for internal commands RD or RMDIR.

I think that this parameter are work with a predefineted variable.

See also the commands DIR or COPY with the variable DIRCMD or COPYCMD.
by trebor68
02 Nov 2013 03:17
Forum: DOS Batch Forum
Topic: Read and create files with . bat
Replies: 7
Views: 6215

Re: Read and create files with . bat

Here a example code: @echo off set StringDestination=### for %%a in ("C:\source\*.txt") do set StringOrigin=%%~na for /l %%d in (1, 1, 5) do echo File: "C:\OutputFolder\%StringDestination%%%d%StringOrigin%.dat" The batch find one txt-file in the folder "C:\source\". If ...
by trebor68
21 Oct 2013 13:55
Forum: DOS Batch Forum
Topic: How to create a option menu
Replies: 10
Views: 8981

Re: How to create a option menu

Here I have change my code. @ECHO off :again ECHO. ECHO 1) Calculator ECHO 2) Timer ECHO 3) Exit SET /P OPT=Which option would you like? IF %OPT%==1 GOTO :Calculator IF %OPT%==2 GOTO :Timer IF %OPT%==3 GOTO :Exit GOTO :again :Calculator ECHO "Code for Calculator" GOTO :again :Timer ECHO &q...
by trebor68
20 Oct 2013 14:17
Forum: DOS Batch Forum
Topic: How to create a option menu
Replies: 10
Views: 8981

Re: How to create a option menu

The following code make a menu. If you will input not a number 1, 2 or 3 then will see the menu again. Every subroutine need an endpoint. This end point may be: - last command in the batch - go to another point in the batch GOTO :zzz - go to the end of the batch :EOF - exit the batch with or without...