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

how to start a batch with CreateProcess

10 views
Skip to first unread message

frax

unread,
Nov 12, 2009, 10:55:02 AM11/12/09
to
Does anybody know how to start a bat-file with CreateProcess ?

I tried:
CreateProcess(L"mybat.bat",NULL....
CreateProcess(L"cmd.exe",L"<mybat.bat"...
CreateProcess(L"cmd.exe",L"cmd.exe <mybat.bat"....

Any ideas ?

Thank you !

Bruce Eitman [eMVP]

unread,
Nov 12, 2009, 11:26:26 AM11/12/09
to
CreateProcess(TEXT("cmd.exe"), TEXT("/c mybat.bat")... should do it. If you
want the window to stay open when the bat file completes try:

CreateProcess(TEXT("cmd.exe"), TEXT("/k mybat.bat")...

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT Eurotech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

Eurotech Inc.
www.Eurotech.com

"frax" <fr...@discussions.microsoft.com> wrote in message
news:F5F09CA0-F393-41FA...@microsoft.com...

frax

unread,
Nov 13, 2009, 3:25:01 AM11/13/09
to
Thank you, this works fine now.

But another question arose: I always thought WinCE has true Unicode support.
But I have now found that bat-files must not be unicode. Is this true ?

"Bruce Eitman [eMVP]" wrote:

> .
>

Bruce Eitman [eMVP]

unread,
Nov 13, 2009, 7:26:06 AM11/13/09
to
Bat files run in cmd - which is a DOS emulator.

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT Eurotech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

Eurotech Inc.
www.Eurotech.com

"frax" <fr...@discussions.microsoft.com> wrote in message

news:A5BB0931-A357-446A...@microsoft.com...

0 new messages