Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cmd.exe using COM2

0 views
Skip to first unread message

Kevin S.

unread,
Mar 12, 2007, 10:47:37 AM3/12/07
to
I am using Windows CE 5.0 and would like to be able to use the
cmd.exe command processor via COM2.

COM2 is working correctly because a small program which simply echos
characters using ReadFile and WriteFile works fine.

Two methods I have tried were to use
-----------------
Method 1:

A small program which executes the following calls was run.

SetStudioPathW(0, L"COM1:");
SetStudioPathW(1, L"COM1:");
SetStudioPathW(2, L"COM1:");

As was suggested by this post:
http://groups.google.com/group/microsoft.public.windowsce.targeted.device/browse_thread/thread/5c720848561a2950/214e106c9fcf8db5?lnk=st&q=SetStdioPathW&rnum=1#214e106c9fcf8db5

However, cmd.exe still seems to be using the keyboard and display for
stdin and stdout after doing this.
--------------------------
Method 2:
http://msdn2.microsoft.com/en-us/library/aa452670.aspx

[HKEY_LOCAL_MACHINE\Drivers\Console]
OutputTo = REG_DWORD:2 // Redirects CMD to COM2
COMSpeed = REG_DWORD:115200 // Speed of serial
connection

I changed the OutputTo value from a '1' into a '2' because my serial
port is COM2
I also changed the example baud rate of 19200 to 115200

After implementing this change to common.reg, cmd.exe no longer shows
up on the display, but also does not seem to send any output to COM2.

-------------------------------

Does anybody have any ideas on how to easily use the serial port for
console input and output?

Thanks,
-Kevin

Henrik Viklund

unread,
Mar 12, 2007, 11:20:32 AM3/12/07
to
The registry settings in "Method 2" is confusing because it uses
decimal values to specify the baud rate. dwords in .reg files are
speced in hex, not decimal so you should add the hex equivalent of the
baudrate into the .reg file.

Henrik Viklund
http://www.addlogic.se

On Mar 12, 3:47 pm, "Kevin S." <dada...@gmail.com> wrote:
> I am using Windows CE 5.0 and would like to be able to use the
> cmd.exe command processor via COM2.
>
> COM2 is working correctly because a small program which simply echos
> characters using ReadFile and WriteFile works fine.
>
> Two methods I have tried were to use
> -----------------
> Method 1:
>
> A small program which executes the following calls was run.
>
> SetStudioPathW(0, L"COM1:");
> SetStudioPathW(1, L"COM1:");
> SetStudioPathW(2, L"COM1:");
>

> As was suggested by this post:http://groups.google.com/group/microsoft.public.windowsce.targeted.de...

Kevin S.

unread,
Mar 13, 2007, 11:48:34 AM3/13/07
to
Thanks Henrik, that solved my problem. It isn't obvious at first
glance that the numeric values are in hex.

-Kevin


0 new messages