Digg this topic Add to my del.icio.us Submit to SlashDot 2 Pages V   1 2 >  
Reply to this topicStart new topic
> International FORMAT "Y", (looking from info from people with NON-English 2K/XP)
jaclaz
post Oct 6 2007, 04:12 PM
Post #1


Finder
***

Group: Advanced user
Posts: 1,118
Joined: 14-July 06
Member No.: 2


Italy


I am writing the MKIMG part of my MBRbatch.cmd.

(for those who didn't see it is a batch to manage MBR's on "real" and "virtual" disks, MKIMG will create and format a HD image of given size/geometry/filesystem)

In the process, I mount the image with VDK and FORMAT it, there is no problem in "interactive" mode, but to make possible to use it as batch with no user intervention I need to "feed" a "Y" (in English) to FORMAT. Besides, I need to use in "interactive mode" the /P switch of DEL to require user confirmation for the deletion of two files, and omit it in "batch" mode.The code is like this:
CODE
....
SET Noprompts=%5
....
IF NOT DEFINED NoPrompts SET PDEL=/P&SET PFormat=FORMAT
FOR %%A IN (o y s) DO IF /I %NoPrompts:~1,2%.==%%A. (SET PDEL=&SET PFormat=echo %%A^| FORMAT ) ELSE (SET PDEL=/P&SET PFormat=FORMAT &SET Noprompts=)
....
%Pformat% %Drive% /FS:%Filesystem% /Q /V:NO_NAME


The effect, given that image is mounted as J: and filesystem is FAT is (on English System):
in "interactive" mode:
CODE
FORMAT J: /FS;FAT /Q /V:NO_NAME

(user is prompted to confirm)

in "batch" mode:
CODE
ECHO Y | FORMAT J: /FS;FAT /Q /V:NO_NAME

(format goes on without user intervention)


For now I have:
S for S (Italian)
O for Oui (French) (IMG:../forums/style_emoticons/default/unsure.gif)
Y for yes (English)

I could well put in the FOR list all letters, in order to let the user use the one he normally uses with his national version of the FORMAT command, but the "narrower" the list is the less prone to problems, and besides it would be nice if I could provide in the docs a list of accepted switches ordered by nations.

Any contribution will be appreciated.

jaclaz
Go to the top of the page
 
+Quote Post
psc
post Oct 6 2007, 04:57 PM
Post #2


Guru
***

Group: .script developer
Posts: 2,987
Joined: 14-July 06
From: Korschenbroich, Germany
Member No.: 3


Germany


QUOTE(jaclaz @ Oct 6 2007, 06:12 PM) *
I am writing the MKIMG part of my MBRbatch.cmd.

.....

Any contribution will be appreciated.

jaclaz

German is 'J' for 'Ja'

Peter
Go to the top of the page
 
+Quote Post
Nuno Brito
post Oct 7 2007, 12:28 AM
Post #3


Advanced Member
***

Group: .script developer
Posts: 4,156
Joined: 13-July 06
From: Azores
Member No.: 1


Portugal


Add "S" for Portuguese ("Sim") and Spanish ("Si") languages (this also includes derivations for Brazil, Angola, Mozambique, Mexico, South America, etc)

(IMG:../forums/style_emoticons/default/cheers.gif)
Go to the top of the page
 
+Quote Post
MedEvil
post Oct 7 2007, 12:51 PM
Post #4


Advanced Member
***

Group: .script developer
Posts: 1,257
Joined: 29-December 06
Member No.: 2,192



Don't forget D for Da, for our russian friends. (IMG:../forums/style_emoticons/default/wink.gif)
Go to the top of the page
 
+Quote Post
jaclaz
post Oct 7 2007, 01:46 PM
Post #5


Finder
***

Group: Advanced user
Posts: 1,118
Joined: 14-July 06
Member No.: 2


Italy


QUOTE(MedEvil @ Oct 7 2007, 02:51 PM) *
Don't forget D for Da, for our russian friends. (IMG:../forums/style_emoticons/default/wink.gif)


Don't Russian users use a cyrillic keyboard and codepage? (IMG:../forums/style_emoticons/default/blink.gif)

i.e. is the character "D" or "д"?

jaclaz

Go to the top of the page
 
+Quote Post
psc
post Oct 7 2007, 03:49 PM
Post #6


Guru
***

Group: .script developer
Posts: 2,987
Joined: 14-July 06
From: Korschenbroich, Germany
Member No.: 3


Germany


Jaclaz,

as you know, I'm not a friend of hardcoded values or lists.

Therefore here my nativeYes suggestion.

It is just a how-to. I'm sure that you are much more experienced in batches and will optimize my code.

But it brings the 'Yes' character into the file 'yes.txt' for all languages which ask for Yes/No like 'bla bla (Y/N)'

CODE
ECHO ? | chkdsk %SystemDrive%/f > result.txt
For /f "tokens=2 delims=(" %%l in (result.txt) do echo %%l > result1.txt
For /f "tokens=1 delims=/" %%l in (result1.txt) do echo %%l > Yes.txt


Peter
Go to the top of the page
 
+Quote Post
MedEvil
post Oct 7 2007, 03:53 PM
Post #7


Advanced Member
***

Group: .script developer
Posts: 1,257
Joined: 29-December 06
Member No.: 2,192



QUOTE(jaclaz @ Oct 7 2007, 03:46 PM) *
Don't Russian users use a cyrillic keyboard and codepage? (IMG:../forums/style_emoticons/default/blink.gif)

i.e. is the character "D" or "д"?

jaclaz

Both as far as i know. Russian keyboards always sport both alphabets.
Anyway, the keycode should be the same.

(IMG:../forums/style_emoticons/default/cheers.gif)
Go to the top of the page
 
+Quote Post
jaclaz
post Oct 7 2007, 06:26 PM
Post #8


Finder
***

Group: Advanced user
Posts: 1,118
Joined: 14-July 06
Member No.: 2


Italy


@psc

Yes, I had thought of something like that, what I usually do is parse the output of "commandx /?", but since the /Y is an undocumented command I didn't think of "provoking a question" to see what the available answers would be, VERY good idea! (IMG:../forums/style_emoticons/default/thumbup.gif)

I'll see if I can provoke (safely) a question (and answer) using the FORMAT command, very remote possibility, but one could have, say, a German CHKDSK and an English FORMAT.

(IMG:../forums/style_emoticons/default/cheers.gif)

jaclaz
Go to the top of the page
 
+Quote Post
Nuno Brito
post Oct 7 2007, 07:49 PM
Post #9


Advanced Member
***

Group: .script developer
Posts: 4,156
Joined: 13-July 06
From: Azores
Member No.: 1


Portugal


QUOTE(psc @ Oct 7 2007, 03:49 PM) *
...

CODE
ECHO ? | chkdsk %SystemDrive%/f > result.txt
For /f "tokens=2 delims=(" %%l in (result.txt) do echo %%l > result1.txt
For /f "tokens=1 delims=/" %%l in (result1.txt) do echo %%l > Yes.txt

..


Amazing little piece of code.. (IMG:../forums/style_emoticons/default/blink.gif) (IMG:../forums/style_emoticons/default/cheers.gif)
Go to the top of the page
 
+Quote Post
jaclaz
post Oct 8 2007, 07:44 PM
Post #10


Finder
***

Group: Advanced user
Posts: 1,118
Joined: 14-July 06
Member No.: 2


Italy


QUOTE(Nuno Brito @ Oct 7 2007, 09:49 PM) *


And you still have to see mine! (IMG:../forums/style_emoticons/default/wink.gif)

@psc

When and if you have time, can you test this on a German system?:
CODE

VDK.EXE Remove
SET Targetpln=testpsc.pln
SET PartType=01
SET Filesystem=FAT
VDK.EXE VIEW %Targetpln%
ECHO.
FOR /F "tokens=1 delims= " %%A in ('VDK.EXE OPEN 0 %Targetpln% /RW^| FIND /I "%PartType%h:"') DO (
SET DRIVE=%%A
)
IF NOT DEFINED DRIVE GOTO :EOF

FOR /F "tokens=2,3 delims=(/)" %%A in ('ECHO ? ^| Format %Drive% /FS:%Filesystem% /Q /V:NO_NAME ^| FIND ")? ?"') DO (
SET YES_Letter=%%A
SET NO_Letter=%%B
)
ECHO %YES_Letter% is first letter of the word that means "Yes" in your language
ECHO %NO_Letter% is first letter of word that means "No" in your language
VDK.EXE Remove


It only works if the filesystem on the drive (an image in this case) has a RAW filesystem, which is exactly the case I need it for.

I am attaching the smallest possible semi-raw image mountable with VDK, and it's .pln descriptor file.

The snippet, the attached files and a copy of VDK.EXE and VDK.SYS should be in the same directory (unless you have VDK.EXE and VDK.SYS already in path).

Thank you in advance.

(IMG:../forums/style_emoticons/default/cheers.gif)

jaclaz


Attached File(s)
Attached File  testpsc.zip ( 1.9k ) Number of downloads: 5
 
Go to the top of the page
 
+Quote Post
« Next Oldest · Boot methods · Next Newest »
 

2 Pages V   1 2 >
Fast ReplyReply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 

Display Mode: Standard · Switch to: Linear+ · Switch to: Outline

Track this topic · Email this topic · Print this topic · Subscribe to this forum

- Lo-Fi Version Time is now: 12th October 2007 - 02:51 PM

MKPortal ©2003-2006 mkportal.it