Google Answers Logo
View Question
 
Q: Batch file command ( No Answer,   0 Comments )
Question  
Subject: Batch file command
Category: Computers > Operating Systems
Asked by: felisque-ga
List Price: $2.00
Posted: 22 Feb 2003 20:57 PST
Expires: 24 Mar 2003 20:57 PST
Question ID: 165845
In Windows ME....
How do I send "Ctrl+Alt+F1" command in a batch file in order to change
my keyboard layout form French to English

Request for Question Clarification by joseleon-ga on 23 Feb 2003 03:39 PST
Hello:
  Do you want to emulate a key combination from a batch file? The only
way I know is to execute a custom Windows program that sends the key
to the system, if you are interested, let me know, but the price of
this question is too low for that task.

Regards.

Clarification of Question by felisque-ga on 23 Feb 2003 08:56 PST
What I want to do is the following:
I often have to work with DOS programs.
With Windows95 and Windows 98, I use this simple one line batch file (
KEYB_E )to switch keyboard layout from French to English:
 
KEYB_E.BAT =
keyb us,,C:\WINDOWS\COMMAND\keyboard.sys

This batch file is not working with Windows ME.  What is the command I
could use in my batch file to do the same thing in Windows ME.

Request for Question Clarification by theta-ga on 23 Feb 2003 11:37 PST
Hi felisque-ga,
     I do not have Windows Me to check out this solution, so I am
posting this as a clarification. To send the required keypress
combination to Windows, you need to use the Windows Scripting Host
that comes installed with Windows Me. For more information on WSH,
check out the following sites :
          - MSDN Online: Windows Scripting
            ( http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?contentid=28001169
)
          - Microsoft Windows Script Host: A Universal Script Host for
Scripting Languages
            ( http://msdn.microsoft.com/archive/en-us/dnarwsh/html/msdn_wsh_wp.asp
)
          - Windows Script Host 5.6 
            ( http://msdn.microsoft.com/msdnmag/issues/02/05/wsh/default.aspx
)

        You should already have WSH installed on your computer. If
not, you can download the latest version of Windows Scripting Host
(version 5.6) from :
            - Microsoft Windows Script 5.6 Download
              ( http://msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?url=/msdn-files/027/001/733/msdncompositedoc.xml
)

  The following code works for me on Windows 98. I use it to simulate
the keypress  "Ctrl+Alt+F1" to activate a shortcut on my desktop. Copy
and paste this code into a file(say 'keypress.vbs'). Click on the file
to run this code.
=========== Begin Code ===========

Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.SendKeys "^%{F1}"

=========== End Code ============

Thats it! Just two lines.

Please try it out, and if the solution works for you, I will be glad
to post it as an answer.
Best Of Luck!
Theta-ga

Request for Question Clarification by theta-ga on 27 Feb 2003 08:22 PST
Hi felisque-ga,
   Did the code supplied above work for you?
Thanks,
Theta-ga

Clarification of Question by felisque-ga on 27 Feb 2003 14:41 PST
I have copied your 2 lines in a batch file.
When I try to call it at the dos prompt, I have the following message
"Bad command or file name"

Request for Question Clarification by arcadesdude-ga on 28 Feb 2003 05:32 PST
Felisque,

Those two commands that Theta-ga suggested don't go in the batch file
themselves. You make a new text file and put those two lines in there
and all the file whatever.vbs (keypress.vbs was suggested).

Then you save the file and put it in the same directory as the bat
file.

In the batch file itself you would use the line:

C:\WINDOWS\WScript.exe keypress.vbs

to run the program. (You would have to change C:\WINDOWS\ to the path
where WScript is (it is probably the same but you might need to change
it) Also keypress.vbs would have to be the name of the file that you
saved it as with a vbs extension).

I can not take credit for it if this works; it is entierly Theta's
merit and credit should be given to him (and not me) if this works.

Request for Question Clarification by theta-ga on 28 Feb 2003 09:52 PST
Hi felisque-ga,
   The first thing you have to do is copy the code into a blank file,
and rename the file "keypress.vbs". There are actually two ways you
can run this code:
   - In Windows, you can execute the file just by double clicking on
it. If you have WScript installed correctly, then it will
automatically execute all .vbs files when you double click on them.
   - If you want to call the file from within a batch file(.BAT), then
just follow the steps arcadesdude-ga laid out for you.

If you need any clarifications, please don't hesitate to ask.
Regards,
Theta-ga

Clarification of Question by felisque-ga on 28 Feb 2003 18:36 PST
HI! Theta-ga
I have tried your last suggestion. (with the batch file and keypress.bat)
It doesn`t work neither in Windows nor at my DOS Prompt.
and WScript.exe is in the Windows directory.

Is there anything else I should try.

(Remember that I need it to work at the DOS PROMPT

Thank you

Request for Question Clarification by theta-ga on 01 Mar 2003 10:41 PST
Hi felisque-ga,
    All that the piece of code does is simulate the keypress
Ctrl+Alt+F1 in Windows. So, it should work if you have that shortcut
key setup to change keyboard languages. You can, of course, select the
shortcut key from Control Panel>Keyboard>Language tab.
    When you say that the code did not work, could you be more
specific? Did you receive some sort of an error message or did the
code execute without any messages, but nothing happened?
    Are you trying to change the language from the command prompt in
Windows, or from the DOS commandline while Windows is starting up?
Thank You,
Theta-ga

Clarification of Question by felisque-ga on 01 Mar 2003 19:40 PST
What I need to do is the following.
My computer runs in Windows ME.  I click
"Start-Programs-Accessories-MSDOS Prompt" in order to work in a MS-DOS
Prompt (black) window.
When I start in that DOS session, by keyboard layout is French.
I want to change it with a batch file (from there, because even if I
change it in the windows session, when I start my DOS session, my DOS
session is with the french keyboard layout.
Thanks

Request for Question Clarification by theta-ga on 02 Mar 2003 01:49 PST
Hi felisque-ga,
    In Windows Me, the keyboard settings for your DOS session are
stored in the registry. You can change them by using the MS System
Configuration Utility.
    The steps you have to take can be found documented a in the
following MS KnowledgeBase Article:
          - Article 261417: Keyboard Command Does Not Work in Command
Prompt
            ( http://support.microsoft.com/default.aspx?scid=kb;en-us;261417
)

    If after changing your settings and restarting your computer, the
problem is still not solved, then you may be suffering from a bug in
some versions of Windows ME. You can find a solution for this in the
following MSKB article:
          - International Keyboard Settings Do Not Work in an MS-DOS
Prompt
            ( http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q272719
)

Please try out the steps outlined in the above articles and tell me if
your problem is solved. If it is, then I will post this as my answer.
If you need any clarifications, please don't hesitate to ask.
Regards,
Theta-ga

Clarification of Question by felisque-ga on 02 Mar 2003 20:31 PST
Hi Theta-ga

The article in Microsoft support you refered me to, mentions that the
"keyb xx" command is not available in Windows ME.
This was the command that I using in windows 95 ? & 98 to change my
layout in a DOS session.
THANK YOU VERY MUCH for trying but I would like to do seems to be
imossible in Windows ME

Request for Question Clarification by theta-ga on 03 Mar 2003 08:32 PST
Hi felisque-ga,
   You will notice that that article also details the method by which
you can change the keyboard language for the DOS session in Windows
ME. Even though the keyb command is not available, you can use the
msconfig utility to change the keyboard language to your liking.
   You can check out the resolution of a similar problem in the
following Google Groups posting:
    - Windows ME and DOS Keyboard Language Issue/Question
      ( http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&th=48e666f82fb4de42
)

   Try out the steps outlined in the MSKB article and see if your
problem is solved. If you need any clarifications, just ask.
Regards,
Theta-ga

Request for Question Clarification by theta-ga on 07 Mar 2003 09:38 PST
Hi felisque-ga,
     Were you able to change your keyboard language as outlined in the
above article? Do you need more instructions?
Regards,
Theta-ga

Request for Question Clarification by googleexpert-ga on 07 Mar 2003 10:37 PST
Hi felisque,
Can you copy the keyb.com or keyb.exe file to your "WinME Computer"?

Clarification of Question by felisque-ga on 07 Mar 2003 15:37 PST
Hi theta-ga

I already knew how to change my keyboard layout with msconfig.
But the computer has to be rebooted.
What I need to do is to switch my keyboard while in a Dos session
without re-booting the computer.
From what I`ve read, it it impossible.
Thanks again for trying
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy