Search found 4558 matches

by aGerman
04 Dec 2011 05:29
Forum: DOS Batch Forum
Topic: How to get EVERY file in DIR including a file number
Replies: 24
Views: 25333

Re: How to get EVERY file in DIR including a file number

drgt wrote:@aGerman

See following error:
G:\>dir /a-d /b /s|findstr /n
FINDSTR: Bad command line

You forgot the dot. It matches "any character". See my origin command line:

Code: Select all

dir /a-d /b /s|findstr /n .

Regards
aGerman
by aGerman
03 Dec 2011 17:11
Forum: DOS Batch Forum
Topic: How to get EVERY file in DIR including a file number
Replies: 24
Views: 25333

Re: How to get EVERY file in DIR including a file number

You wrote that you want to get every file . In this case you have to exclude folders using dir /a-d . A simple way to display a number for each file is to pipe the dir output to findstr. dir /a-d /b /s|findstr /n . It's also possible to process this output in a for /f loop. for /f "tokens=1* de...
by aGerman
03 Dec 2011 13:36
Forum: DOS Batch Forum
Topic: Folder Making
Replies: 3
Views: 4025

Re: Folder Making

Not sure what you're looking for.
Try something like that:

Code: Select all

@echo off
set A=1
set B=2
set C=3
set D=4
set E=5

md %A%
cd %A%
md %B%
md %C%
md %D%
md %E%

What is that good for?

Regards
aGerman
by aGerman
02 Dec 2011 12:31
Forum: DOS Batch Forum
Topic: redirection >&1 >&2 >&3 >&4
Replies: 6
Views: 7992

Re: redirection >&1 >&2 >&3 >&4

There seem to be 4 predefined streams 0 stdIn 1 stdOut 2 stdErr 3 incoming file stream ____________________________________________________ You could display the stream numbers 0 and 1 *.bat @prompt $g$s >xyz.txt echo( <xyz.txt more +1 @echo off del xyz.txt pause>nul Output: > echo( 1>xyz.txt > more...
by aGerman
30 Nov 2011 15:07
Forum: DOS Batch Forum
Topic: encodings
Replies: 11
Views: 21261

Re: encodings

You said "..Lucida Console indeed supports characters wider than 2 Bytes (>0xFF)." >0xFF is wider than one byte Oh, you're absolutely right. 2 Hex digits represent 1 Byte. For some strange reason I mixed it up I hope you however understood what I was talking about. I fiddled with my regis...
by aGerman
29 Nov 2011 13:30
Forum: DOS Batch Forum
Topic: encodings
Replies: 11
Views: 21261

Re: encodings

Saying a font supports unicode is a funny thing.. It's maybe not exactly fitting but it's not that funny since Lucida Console indeed supports characters wider than 2 Bytes (>0xFF). First I opened charmap, selected Lucida Console and character set Unicode. I copied character 0x0414 (capital cyrillic...
by aGerman
28 Nov 2011 17:40
Forum: DOS Batch Forum
Topic: encodings
Replies: 11
Views: 21261

Re: encodings

I use the rastered font because it's the default in western europe, US and many others. Lucida Console supports unicode which enables characters with more than 2 Bytes width (e.g. Chinese, Japanese, perhaps Russian ...). I never experimented with it, for that reason I don't know how it changes the b...
by aGerman
28 Nov 2011 17:11
Forum: DOS Batch Forum
Topic: rename problem
Replies: 2
Views: 3451

Re: rename problem

The help for REN is Renames a file or files. RENAME [drive:][path]filename1 filename2. REN [drive:][path]filename1 filename2. Note that you cannot specify a new drive or path for your destination file. The last sentence shows your fault. You must not specify the drive and path in the second argument...
by aGerman
28 Nov 2011 17:04
Forum: DOS Batch Forum
Topic: Variables within ftp txt file, please help
Replies: 2
Views: 3919

Re: Variables within ftp txt file, please help

I'm not familiar with that FTP stuff. For that reason I normally avoid to reply to such topics. But in your case it's obvious why it doesn't work. You have to strictly separate the following: 1. Batch files are interpreted by cmd.exe. The commands in a batch file have nothing to do with the commands...
by aGerman
27 Nov 2011 19:35
Forum: DOS Batch Forum
Topic: encodings
Replies: 11
Views: 21261

Re: encodings

I experimented on my command prompt and found the same behavior: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten. C:\windows\system32>prompt $g$s > rem what's the current codepage? > chcp Aktive Codepage: 850. > rem try to paste the registered t...
by aGerman
27 Nov 2011 18:24
Forum: DOS Batch Forum
Topic: [SOLVED] SET /a -- Random Number?
Replies: 24
Views: 46260

Re: [SOLVED] SET /a -- Random Number?

It depends on your locale settings which codepages are used. You will find them in the registry. @echo off &setlocal for /f "tokens=2*" %%i in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePage" /v "OEMCP"') do set /a OEMCP=%%j for /f "tokens=2*&qu...
by aGerman
26 Nov 2011 13:39
Forum: DOS Batch Forum
Topic: Need a help to write a simple c program
Replies: 1
Views: 2166

Re: Need a help to write a simple c program

Hi Ravk.

We always try to help but in your case I couldn't help skipping the reason behind. We won't solve your homework.
Further more this is a Batch forum and C programming is off topic.

Regards
aGerman
by aGerman
26 Nov 2011 13:11
Forum: DOS Batch Forum
Topic: how to process ALL lines of text in a file, including BLANKS
Replies: 6
Views: 6260

Re: how to process ALL lines of text in a file, including BL

Hi Alan. Please explain WHEN the quotes might be needed Well, it's only to protect you from trailing spaces. Your code should work as well, but that wouldn't ... set ln= & set /p ln= ... due to the space between equal sign and ampersand. I'm not sure about your second problem. You could try to w...
by aGerman
24 Nov 2011 16:49
Forum: DOS Batch Forum
Topic: Limit CMD processing to internal commands, safer and faster?
Replies: 16
Views: 28657

Re: Limit CMD processing to internal commands, safer and fas

Interesting attempt :)

@jeb
For some reason it works by creating a "false" PATHEXT environment.

Code: Select all

set "PathExt=$"


Regards
aGerman
by aGerman
22 Nov 2011 13:13
Forum: DOS Batch Forum
Topic: Batch that will run only if another file exists.
Replies: 1
Views: 3119

Re: Batch that will run only if another file exists.

Code: Select all

@echo off
if not exist "aaaa" (
  echo COULD NOT FIND 'aaaa' ABORT.
  pause>NUL
  goto :eof
)
:MENU
echo your stuff here ...
pause

Regards
aGerman