Search found 146 matches

by trebor68
20 Apr 2013 00:13
Forum: DOS Batch Forum
Topic: Has anyone else use this construct ?
Replies: 4
Views: 4321

Re: Has anyone else use this construct ?

I have tested the following codes. @echo off setlocal enableextensions enabledelayedexpansion echo. echo SETLOCAL with ENABLEDELAYEDEXPANSION if !"%~1" equ ""! goto :whatever echo. echo First parameter: %1 goto :eof :whatever echo. echo No parameter. @echo off setlocal enableexte...
by trebor68
19 Apr 2013 06:46
Forum: DOS Batch Forum
Topic: Convertir un Nombre en Lettre‎ [ FR ]
Replies: 24
Views: 19093

Re: Convertir un Nombre en Lettre‎ [ FR ]

Here the rules for numbers in German language: German language I use "-" here only for a better overview. The word is writing without this sign. When I write block number see this: 100,000,000,000,000 4 3 2 1 0 block number 0 = null numbers 1 to 20 ein zwei drei vier fünf sechs sieben acht...
by trebor68
17 Apr 2013 03:44
Forum: DOS Batch Forum
Topic: Convertir un Nombre en Lettre‎ [ FR ]
Replies: 24
Views: 19093

Re: Convertir un Nombre en Lettre‎ [ FR ]

In the code from Aacini is coming a error when " CMD /e:off ". Please also change the row with " setlocal EnableDelayedExpansion " to this entry " setlocal EnableExtensions EnableDelayedExpansion ". Note for viewing in German language. Numbers up to 999 999 are written ...
by trebor68
17 Apr 2013 02:49
Forum: DOS Batch Forum
Topic: Convertir un Nombre en Lettre‎ [ FR ]
Replies: 24
Views: 19093

Re: Convertir un Nombre en Lettre‎ [ FR ]

This error is coming when "CMD /v:off".

I have found the error in my batch file.

Please change any row with "setlocal enableextensions" to this entry "setlocal enableextensions EnableDelayedExpansion".

Thanks to Aacini and Foxdrive for your postings.
by trebor68
16 Apr 2013 17:17
Forum: DOS Batch Forum
Topic: Convertir un Nombre en Lettre‎ [ FR ]
Replies: 24
Views: 19093

Re: Convertir un Nombre en Lettre‎ [ FR ]

Numbers greater than one million have several names. I've created a batch file that shows this. The number can be entered as a parameter but without a space, comma or dot. The number can consist of up to 36 digits. The display will show the number in the first column as a mathematical expression. Th...
by trebor68
25 Mar 2013 02:40
Forum: DOS Batch Forum
Topic: asterisk not working in file name
Replies: 4
Views: 4576

Re: asterisk not working in file name

Now I have more time to write here. If the variable set before the command SETLOCAL in the batch then: @echo off set var1=Trebor68 setlocal enabledelayedexpansion for /f "delims=" %%a in (test34.txt) do ( echo %%a set var1=!var1!%%a echo !var1! echo. ) endlocal echo %var1% Here the output:...
by trebor68
24 Mar 2013 10:35
Forum: DOS Batch Forum
Topic: asterisk not working in file name
Replies: 4
Views: 4576

Re: asterisk not working in file name

The command FINDSTR will perfect work with more as one file. FINDSTR "example" file_1.txt FINDSTR "example" file_1.txt file_2.txt file_3.txt FINDSTR "example" file_*.txt" FINDSTR /F:file_list.txt "example" The first row will only use one file. The output ...
by trebor68
25 Oct 2012 15:54
Forum: DOS Batch Forum
Topic: Help with a batch
Replies: 8
Views: 6244

Re: Help with a batch

Here not tested code. This code will work when a file "nameofmovie.mkv" exist. @echo off for %%a in (*.mkv) do ( md "%%~na" 2>nul move "%%~na*.*" "%%~na" ) This code will not work perfect when you have files like this: NameOfMovie.mkv NameOfMovie 2 .mkv
by trebor68
25 Oct 2012 15:24
Forum: DOS Batch Forum
Topic: Check variable is number
Replies: 9
Views: 12347

Re: Check variable is number

One way to check if a variable is not negativ is following code. @echo off for /l %%a in (-15,1,15) do echo %%a| findstr /r "^[1-9][0-9]*$">nul && echo %%a This code work perfectly when the number have not any characters as the numbers. i.E "2", "23", "234&...
by trebor68
17 Sep 2012 09:06
Forum: DOS Batch Forum
Topic: Can I divide my result?
Replies: 13
Views: 10452

Re: Can I divide my result?

I have tested following code. The command CALL have two parameters: param1 - the free size without the comma (in some countrys is there a point) param2 - how many time you will divide 1024; 1 for KiB, 2 for MiB, 3 for GiB and 4 for TiB @echo off for /f "tokens=3" %%a in ('dir ^| find "...
by trebor68
24 Aug 2012 15:15
Forum: DOS Batch Forum
Topic: color
Replies: 6
Views: 5305

Re: color

If you run the CMD command with short cut "Win + R" can you use the option "/t" to select the colors. Without the option "/t" is used the color that is definated in "DefaultColor". If the value in " DefaultColor " one of the following hex value: 00 1...
by trebor68
24 Aug 2012 01:24
Forum: DOS Batch Forum
Topic: color
Replies: 6
Views: 5305

Re: color

I think that the change of properties can find with the following XP command: reg query "HKU\.DEFAULT\Console" /v "ScreenColors" The standard of ScreenColor value is hex07. background color = 0 = black text color = 7 = light gray To reset to standard value in the CMD window: COLO...
by trebor68
11 Aug 2012 05:34
Forum: DOS Batch Forum
Topic: script with modulus
Replies: 4
Views: 3978

Re: script with modulus

You will want two integer value for this value with decimal numbers. value = x / y I will use the format that we use in Germany. in Germany format: 1.234,567 One thousand two hundred thirty-four comma five six seven in English format: 1,234.567 One thousand two hundred thirty-four point five six sev...
by trebor68
06 May 2012 09:04
Forum: DOS Batch Forum
Topic: Echo command and environment variable
Replies: 8
Views: 7031

Re: Echo command and environment variable

I hope that I understand you.

You will not write the value of the variable %WINDIR% in the file.
You will write %WINDIR% in the file.

Code: Select all

ECHO The windows folder will you find in ^%WINDIR^%.>outputfile.txt

The result is:
    The windows folder will you find in %WINDIR%.
by trebor68
29 Apr 2012 11:00
Forum: DOS Batch Forum
Topic: Getting free space of a mapped network drive in GBs
Replies: 17
Views: 15139

Re: Getting free space of a mapped network drive in GBs

If you will round a value you need one number more decimal in the result. Please change the parameter to 3 drecimal in the command str_math. value xxxx.yyz If z have the value 5, 6, 7, 8 or 9 will round up. result is yy+1 if yy+1 = 100 then xxxx+1 With z and the value 0, 1, 2, 3, 4 round down. The b...