Warning: krsort() expects parameter 1 to be array, null given in /home/.fluke/nuno_brito/boot-land.net/forums/sources/d22mods/mvtt.php on line 58

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/.fluke/nuno_brito/boot-land.net/forums/sources/d22mods/mvtt.php on line 59
International FORMAT "Y" - Boot Land
 
> 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,158
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) 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
Digg this topic Add to my del.icio.us 2 Pages V   1 2 >  
Start new topic
Replies (1 - 9)
psc
post Oct 6 2007, 04:57 PM
Post #2


Guru
***

Group: .script developer
Posts: 3,108
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


--------------------
Build the house starting with the the basement rather than with the roof! But always have in mind how the roof should be made!

There are very rarely problems, in most cases there are issues.

There are never stupid questions, there can be only stupid answers
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,245
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)

cheers.gif


--------------------
Use the search tool to find all posts made by other members and help you solve any doubts quickly by yourself.
Whenever possible - place your questions including as many details as you can to help us help you - Thanks!

nuno? --> pics
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,290
Joined: 29-December 06
Member No.: 2,192



Don't forget D for Da, for our russian friends. 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,158
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. wink.gif


Don't Russian users use a cyrillic keyboard and codepage? 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: 3,108
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


--------------------
Build the house starting with the the basement rather than with the roof! But always have in mind how the roof should be made!

There are very rarely problems, in most cases there are issues.

There are never stupid questions, there can be only stupid answers
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,290
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? 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.

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,158
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! 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.

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,245
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.. blink.gif cheers.gif


--------------------
Use the search tool to find all posts made by other members and help you solve any doubts quickly by yourself.
Whenever possible - place your questions including as many details as you can to help us help you - Thanks!

nuno? --> pics
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,158
Joined: 14-July 06
Member No.: 2


Italy


QUOTE (Nuno Brito @ Oct 7 2007, 09:49 PM) *
Amazing little piece of code.. blink.gif cheers.gif


And you still have to see mine! 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.

cheers.gif

jaclaz
Attached File(s)
Attached File  testpsc.zip ( 1.9K ) Number of downloads: 8
 
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic

Members Who Viewed Topic Today ()

 

RSS Lo-Fi Version Time is now: 23rd October 2007 - 08:01 AM

MKPortal ©2003-2006 mkportal.it