2 * CSCRIPT Implementation
4 * Copyright 2011 André Hentschel
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #define WIN32_LEAN_AND_MEAN
26 #include <wine/debug.h>
27 #include <wine/unicode.h>
29 WINE_DEFAULT_DEBUG_CHANNEL(cscript
);
31 int WINAPI
wWinMain(HINSTANCE hInst
, HINSTANCE hPrevInst
, LPWSTR cmdline
, int cmdshow
)
33 static const WCHAR wscriptW
[] = {'\\','w','s','c','r','i','p','t','.','e','x','e',0};
34 static const WCHAR parbW
[] = {' ','/','B',' ',0};
37 PROCESS_INFORMATION pi
;
40 STARTUPINFOW si
= { sizeof(si
) };
42 WINE_FIXME("(%p %p %s %x) forwarding to wscript\n", hInst
, hPrevInst
, wine_dbgstr_w(cmdline
), cmdshow
);
44 GetSystemDirectoryW(app
, MAX_PATH
);
45 strcatW(app
, wscriptW
);
48 strcatW(cmd
, cmdline
);
50 if (!CreateProcessW(app
, cmd
, NULL
, NULL
, FALSE
, 0, NULL
, NULL
, &si
, &pi
)) return 1;
51 WaitForSingleObject( pi
.hProcess
, INFINITE
);
53 ret
= GetExitCodeProcess(pi
.hProcess
, &exitcode
);
54 CloseHandle( pi
.hProcess
);
55 CloseHandle( pi
.hThread
);